From a9325fa237dde2654bc841c2bb0a05fc3e57696a Mon Sep 17 00:00:00 2001 From: "halcanary@google.com" Date: Fri, 10 Jan 2014 14:58:10 +0000 Subject: Add REPORTF test macro. This macro replaces: SkString str; str.printf("Foo test Expected %d got %d", x, y); reporter->reportFailed(str); with the shorter code: REPORTF(reporter, ("Foo test Expected %d got %d", x, y)); The new form also appends __FILE__:__LINE__ to the message before calling reportFailed(). BUG= R=mtklein@google.com Review URL: https://codereview.chromium.org/132843002 git-svn-id: http://skia.googlecode.com/svn/trunk@13016 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/MathTest.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/MathTest.cpp') diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp index 8cba67dd3d..58dd0c6399 100644 --- a/tests/MathTest.cpp +++ b/tests/MathTest.cpp @@ -225,10 +225,8 @@ static bool equal_float_native_skia(float x, uint32_t ni, uint32_t si) { static void assert_float_equal(skiatest::Reporter* reporter, const char op[], float x, uint32_t ni, uint32_t si) { if (!equal_float_native_skia(x, ni, si)) { - SkString desc; - uint32_t xi = SkFloat2Bits(x); - desc.printf("%s float %g bits %x native %x skia %x\n", op, x, xi, ni, si); - reporter->reportFailed(desc); + ERRORF(reporter, "%s float %g bits %x native %x skia %x\n", + op, x, SkFloat2Bits(x), ni, si); } } -- cgit v1.2.3