diff options
author | halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-10 14:58:10 +0000 |
---|---|---|
committer | halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-10 14:58:10 +0000 |
commit | a9325fa237dde2654bc841c2bb0a05fc3e57696a (patch) | |
tree | 3d5952d42ac35f0c9200887215c47dcb14122e41 /tests/PathCoverageTest.cpp | |
parent | 9acb8cdf20423e80d5687ba3c8e11545e3bc8020 (diff) |
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
Diffstat (limited to 'tests/PathCoverageTest.cpp')
-rw-r--r-- | tests/PathCoverageTest.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/PathCoverageTest.cpp b/tests/PathCoverageTest.cpp index 25b5fd1c09..c133e9cccc 100644 --- a/tests/PathCoverageTest.cpp +++ b/tests/PathCoverageTest.cpp @@ -137,14 +137,11 @@ static bool one_d_pe(const int* array, const unsigned int count, (estimatedCount <= 2 * computedCount); if (!isAccurate) { - SkString errorDescription; - errorDescription.printf( - "Curve from %.2f %.2f through %.2f %.2f to %.2f %.2f " - "computes %d, estimates %d\n", - path[0].fX, path[0].fY, path[1].fX, path[1].fY, - path[2].fX, path[2].fY, computedCount, estimatedCount); + ERRORF(reporter, "Curve from %.2f %.2f through %.2f %.2f to " + "%.2f %.2f computes %d, estimates %d\n", + path[0].fX, path[0].fY, path[1].fX, path[1].fY, + path[2].fX, path[2].fY, computedCount, estimatedCount); numErrors++; - reporter->reportFailed(errorDescription); } } |