return size;
}
-static void android_options_serialization(skiatest::Reporter* reporter) {
+DEF_TEST(AndroidOptionsSerialization, reporter) {
// We want to make sure that Android's paint options survive a flatten/unflatten round trip.
// These are all non-default options.
SkPaintOptionsAndroid options;
REPORTER_ASSERT(reporter, options == reconstructed.getPaintOptionsAndroid());
}
-DEFINE_TESTCLASS_SHORT(android_options_serialization);
-static void android_options_serialization_reverse(skiatest::Reporter* reporter) {
+DEF_TEST(AndroidOptionsSerializationReverse, reporter) {
// Opposite test of above: make sure the serialized default values of a paint overwrite
// non-default values on the paint we're unflattening into.
const SkPaint defaultOptions;
defaultOptions.getPaintOptionsAndroid() ==
nonDefaultOptions.getPaintOptionsAndroid());
}
-DEFINE_TESTCLASS_SHORT(android_options_serialization_reverse);
-static void android_options_size(skiatest::Reporter* reporter) {
+DEF_TEST(AndroidOptionsSize, reporter) {
// A paint with default android options should serialize to something smaller than
// a paint with non-default android options.
REPORTER_ASSERT(reporter,
Reconstruct(defaultOptions, &dummy) < Reconstruct(nonDefaultOptions, &dummy));
}
-DEFINE_TESTCLASS_SHORT(android_options_size);
#endif // SK_BUILD_FOR_ANDROID
#include "SkOpSegment.h"
#include "SkTArray.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkPoint cubics[][4] = {
/* 0 */ {{0, 1}, {2, 6}, {4, 2}, {5, 3}},
}
}
-static void PathOpsAngleTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsAngle, reporter) {
for (size_t index = 0; index < SK_ARRAY_COUNT(tests); ++index) {
const SortSetTests& test = tests[index];
testOne(reporter, test);
}
}
-static void PathOpsAngleTestOne(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsAngleTestOne, reporter) {
size_t index = 0;
const SortSetTests& test = tests[index];
testOne(reporter, test);
{-2.1033774145221198, -1.4046019261273715e-008, -0.70062688352066704, -1.2706324683777995e-008},
};
-static void PathOpsAngleFindSlop(skiatest::Reporter* reporter) {
+/*DEF_TEST(PathOpsAngleFindSlop, reporter) {
for (size_t index = 0; index < SK_ARRAY_COUNT(slopTests); ++index) {
const double* slopTest = slopTests[index];
double x = slopTest[0];
angle, rAngle, diff, (int) (diff / FLT_EPSILON));
}
-}
+}*/
#endif
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsAngleTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsAngleTestOne)
-
-// DEFINE_TESTCLASS_SHORT(PathOpsAngleFindSlop)
#include "PathOpsTestCommon.h"
#include "SkPathOpsBounds.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkRect sectTests[][2] = {
{{2, 0, 4, 1}, {4, 0, 6, 1}},
static const size_t notEmptyTestsCount = SK_ARRAY_COUNT(notReallyEmpty);
-static void PathOpsBoundsTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsBounds, reporter) {
for (size_t index = 0; index < sectTestsCount; ++index) {
const SkPathOpsBounds& bounds1 = static_cast<const SkPathOpsBounds&>(sectTests[index][0]);
SkASSERT(ValidBounds(bounds1));
(bounds.*SetCurveBounds[3])(curvePts);
REPORTER_ASSERT(reporter, bounds == expected);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsBoundsTest)
#include "SkPathOpsRect.h"
#include "SkReduceOrder.h"
#include "Test.h"
+#include "TestClassDef.h"
const int firstCubicIntersectionTest = 9;
}
}
-static void PathOpsCubicCoinOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsCubicCoinOneOff, reporter) {
coinOneOff(reporter, 0);
}
-static void PathOpsCubicIntersectionOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsCubicIntersectionOneOff, reporter) {
newOneOff(reporter, 0, 1);
}
-static void PathOpsCubicSelfOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsCubicSelfOneOff, reporter) {
selfOneOff(reporter, 0);
}
-static void PathOpsCubicIntersectionTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsCubicIntersection, reporter) {
oneOffTests(reporter);
cubicIntersectionSelfTest(reporter);
cubicIntersectionCoinTest(reporter);
if (false) CubicIntersection_IntersectionFinder();
if (false) CubicIntersection_RandTest(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsCubicIntersectionOneOffTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsCubicSelfOneOffTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsCubicCoinOneOffTest)
#include "SkPathOpsLine.h"
#include "SkReduceOrder.h"
#include "Test.h"
+#include "TestClassDef.h"
static struct lineCubic {
SkDCubic cubic;
}
}
-static void PathOpsCubicLineIntersectionTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsCubicLineIntersection, reporter) {
for (size_t index = 0; index < lineCubicTests_count; ++index) {
int iIndex = static_cast<int>(index);
testOne(reporter, iIndex);
}
}
-static void PathOpsCubicLineIntersectionOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsCubicLineIntersectionOneOff, reporter) {
int iIndex = 0;
testOne(reporter, iIndex);
const SkDCubic& cubic = lineCubicTests[iIndex].cubic;
sect.distance(i.pt(0)), cubic[3].distance(prevL));
#endif
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsCubicLineIntersectionTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsCubicLineIntersectionOneOffTest)
#include "SkPathOpsQuad.h"
#include "SkReduceOrder.h"
#include "Test.h"
+#include "TestClassDef.h"
static struct lineCubic {
SkDCubic cubic;
static const size_t quadCubicTests_count = SK_ARRAY_COUNT(quadCubicTests);
-static void PathOpsCubicQuadIntersectionTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsCubicQuadIntersection, reporter) {
for (size_t index = 0; index < quadCubicTests_count; ++index) {
int iIndex = static_cast<int>(index);
const SkDCubic& cubic = quadCubicTests[index].cubic;
reporter->bumpTestCount();
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsCubicQuadIntersectionTest)
#include "SkPathOpsRect.h"
#include "SkReduceOrder.h"
#include "Test.h"
+#include "TestClassDef.h"
#if 0 // disable test until stroke reduction is supported
static bool controls_inside(const SkDCubic& cubic) {
}
#endif
-static void PathOpsReduceOrderCubicTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsReduceOrderCubic, reporter) {
size_t index;
SkReduceOrder reducer;
int order;
}
#endif
}
-
-#include "TestClassDef.h"
-
-DEFINE_TESTCLASS_SHORT(PathOpsReduceOrderCubicTest)
#include "SkPathOpsRect.h"
#include "SkReduceOrder.h"
#include "Test.h"
+#include "TestClassDef.h"
static void test(skiatest::Reporter* reporter, const SkDCubic* cubics, const char* name,
int firstTest, size_t testCount) {
}
}
-static void CubicToQuads_Test(skiatest::Reporter* reporter) {
+DEF_TEST(CubicToQuads, reporter) {
enum {
RunAll,
RunPointDegenerates,
if (false) SkDebugf("%s quads=%d\n", __FUNCTION__, quads.count());
}
-static void CubicsToQuadratics_OneOffTests(skiatest::Reporter* reporter) {
+DEF_TEST(CubicsToQuadratics_OneOff_Loop, reporter) {
for (size_t x = 0; x < localsCount; ++x) {
oneOff(reporter, x);
}
}
-static void CubicsToQuadratics_OneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(CubicsToQuadratics_OneOff_Single, reporter) {
oneOff(reporter, 0);
}
-
-static void PathOpsCubicToQuadsTest(skiatest::Reporter* reporter) {
- CubicToQuads_Test(reporter);
- CubicsToQuadratics_OneOffTest(reporter);
- CubicsToQuadratics_OneOffTests(reporter);
-}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsCubicToQuadsTest)
#include "PathOpsTestCommon.h"
#include "SkPathOpsCubic.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkDCubic tests[] = {
{{{2, 0}, {3, 1}, {2, 2}, {1, 1}}},
static const size_t tests_count = SK_ARRAY_COUNT(tests);
-static void PathOpsDCubicTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsDCubic, reporter) {
for (size_t index = 0; index < tests_count; ++index) {
const SkDCubic& cubic = tests[index];
SkASSERT(ValidCubic(cubic));
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsDCubicTest)
#include "PathOpsTestCommon.h"
#include "SkPathOpsLine.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkDLine tests[] = {
{{{2, 1}, {2, 1}}},
static const size_t tests_count = SK_ARRAY_COUNT(tests);
-static void PathOpsLineUtilitiesTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsLineUtilities, reporter) {
for (size_t index = 0; index < tests_count; ++index) {
const SkDLine& line = tests[index];
SkASSERT(ValidLine(line));
REPORTER_ASSERT(reporter, approximately_equal((line[0].fY + line[1].fY) / 2, mid.fY));
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsLineUtilitiesTest)
#include "PathOpsTestCommon.h"
#include "SkPathOpsPoint.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkDPoint tests[] = {
{0, 0},
static const size_t tests_count = SK_ARRAY_COUNT(tests);
-static void PathOpsDPointTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsDPoint, reporter) {
for (size_t index = 0; index < tests_count; ++index) {
const SkDPoint& pt = tests[index];
SkASSERT(ValidPoint(pt));
sqrt(pt.fX * pt.fX + pt.fY * pt.fY)));
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsDPointTest)
#include "SkPathOpsQuad.h"
#include "SkRRect.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkDQuad tests[] = {
{{{1, 1}, {2, 1}, {0, 2}}},
static const size_t tests_count = SK_ARRAY_COUNT(tests);
-static void PathOpsDQuadTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsDQuad, reporter) {
for (size_t index = 0; index < tests_count; ++index) {
const SkDQuad& quad = tests[index];
SkASSERT(ValidQuad(quad));
}
}
-static void PathOpsRRectTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsRRect, reporter) {
SkPath path;
SkRRect rRect;
SkRect rect = {135, 143, 250, 177};
rRect.setRectRadii(rect, radii);
path.addRRect(rRect);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsDQuadTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsRRectTest)
#include "SkPathOpsQuad.h"
#include "SkPathOpsRect.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkDLine lineTests[] = {
{{{2, 1}, {2, 1}}},
static const size_t quadTests_count = SK_ARRAY_COUNT(quadTests);
static const size_t cubicTests_count = SK_ARRAY_COUNT(cubicTests);
-static void PathOpsDRectTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsDRect, reporter) {
size_t index;
SkDRect rect, rect2;
for (index = 0; index < lineTests_count; ++index) {
REPORTER_ASSERT(reporter, rect.contains(rightBottom));
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsDRectTest)
#include "PathOpsTestCommon.h"
#include "SkPathOpsTriangle.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkDTriangle tests[] = {
{{{2, 0}, {3, 1}, {2, 2}}},
static const size_t tests_count = SK_ARRAY_COUNT(tests);
-static void PathOpsTriangleUtilitiesTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsTriangleUtilities, reporter) {
for (size_t index = 0; index < tests_count; ++index) {
const SkDTriangle& triangle = tests[index];
SkASSERT(ValidTriangle(triangle));
static const size_t oneOff_count = SK_ARRAY_COUNT(oneOff);
-static void PathOpsTriangleOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsTriangleOneOff, reporter) {
for (size_t index = 0; index < oneOff_count; ++index) {
const SkDTriangle& triangle = oneOff[index];
SkASSERT(ValidTriangle(triangle));
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsTriangleUtilitiesTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsTriangleOneOffTest)
#include "PathOpsTestCommon.h"
#include "SkPathOpsPoint.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkDPoint tests[] = {
{0, 0},
static const size_t tests_count = SK_ARRAY_COUNT(tests);
-static void PathOpsDVectorTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsDVector, reporter) {
for (size_t index = 0; index < tests_count - 1; ++index) {
SkDVector v1 = tests[index + 1] - tests[index];
SkASSERT(ValidVector(v1));
REPORTER_ASSERT(reporter, v1Cross == 0);
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsDVectorTest)
* found in the LICENSE file.
*/
#include "PathOpsExtendedTest.h"
+#include "TestClassDef.h"
-static void PathOpsInverseTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsInverse, reporter) {
SkPath one, two;
for (int op = kDifference_PathOp; op <= kReverseDifference_PathOp; ++op) {
for (int oneFill = SkPath::kWinding_FillType; oneFill <= SkPath::kInverseEvenOdd_FillType;
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsInverseTest)
#include "SkIntersections.h"
#include "SkPathOpsLine.h"
#include "Test.h"
+#include "TestClassDef.h"
// FIXME: add tests for intersecting, non-intersecting, degenerate, coincident
static const SkDLine tests[][2] = {
reporter->bumpTestCount();
}
-static void PathOpsLineIntersectionTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsLineIntersection, reporter) {
size_t index;
for (index = 0; index < coincidentTests_count; ++index) {
const SkDLine& line1 = coincidentTests[index][0];
}
}
-static void PathOpsLineIntersectionOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsLineIntersectionOneOff, reporter) {
int index = 0;
SkASSERT(index < (int) tests_count);
testOne(reporter, tests[index][0], tests[index][1]);
testOne(reporter, tests[1][0], tests[1][1]);
}
-static void PathOpsLineIntersectionOneCoincidentTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsLineIntersectionOneCoincident, reporter) {
int index = 0;
SkASSERT(index < (int) coincidentTests_count);
const SkDLine& line1 = coincidentTests[index][0];
const SkDLine& line2 = coincidentTests[index][1];
testOneCoincident(reporter, line1, line2);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsLineIntersectionTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsLineIntersectionOneOffTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsLineIntersectionOneCoincidentTest)
#include "PathOpsTestCommon.h"
#include "SkLineParameters.h"
#include "Test.h"
+#include "TestClassDef.h"
// tests to verify that distance calculations are coded correctly
static const SkDCubic tests[] = {
static const size_t tests_count = SK_ARRAY_COUNT(tests);
-static void PathOpsLineParametersTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsLineParameters, reporter) {
for (size_t index = 0; index < tests_count; ++index) {
SkLineParameters lineParameters;
const SkDCubic& cubic = tests[index];
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsLineParametersTest)
*/
#include "PathOpsExtendedTest.h"
#include "PathOpsThreadedCommon.h"
+#include "TestClassDef.h"
-static void testOpCubicsMain(PathOpsThreadState* data)
-{
+static void testOpCubicsMain(PathOpsThreadState* data) {
#if DEBUG_SHOW_TEST_NAME
strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
#endif
}
}
-static void PathOpsOpCubicsThreadedTest(skiatest::Reporter* reporter)
-{
+DEF_TEST(PathOpsOpCubicsThreaded, reporter) {
int threadCount = initializeTests(reporter, "cubicOp");
PathOpsThreadedTestRunner testRunner(reporter, threadCount);
for (int a = 0; a < 6; ++a) { // outermost
finish:
testRunner.render();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsOpCubicsThreadedTest)
*/
#include "PathOpsExtendedTest.h"
#include "PathOpsThreadedCommon.h"
+#include "TestClassDef.h"
// four rects, of four sizes
// for 3 smaller sizes, tall, wide
}
}
-static void PathOpsRectsThreadedTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsRectsThreaded, reporter) {
int threadCount = initializeTests(reporter, "testOp");
PathOpsThreadedTestRunner testRunner(reporter, threadCount);
for (int a = 0; a < 6; ++a) { // outermost
finish:
testRunner.render();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsRectsThreadedTest)
* found in the LICENSE file.
*/
#include "PathOpsExtendedTest.h"
+#include "TestClassDef.h"
#define TEST(name) { name, #name }
static bool runReverse = false;
static void (*stopTest)(skiatest::Reporter* ) = 0;
-static void PathOpsOpTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsOp, reporter) {
#ifdef SK_DEBUG
SkPathOpsDebug::gMaxWindSum = 4;
SkPathOpsDebug::gMaxWindValue = 4;
SkPathOpsDebug::gMaxWindValue = SK_MaxS32;
#endif
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsOpTest)
#include "SkPathOpsRect.h"
#include "SkReduceOrder.h"
#include "Test.h"
+#include "TestClassDef.h"
static void standardTestCases(skiatest::Reporter* reporter) {
bool showSkipped = false;
}
}
-static void PathOpsQuadIntersectionOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsQuadIntersectionOneOff, reporter) {
oneOffTest1(reporter, 0, 1);
}
}
}
-static void PathOpsQuadIntersectionCoincidenceOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsQuadIntersectionCoincidenceOneOff, reporter) {
coincidentTestOne(reporter, 0, 1);
}
intersectionFinder(0, 1);
}
-static void PathOpsQuadIntersectionTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsQuadIntersection, reporter) {
oneOffTests(reporter);
coincidentTest(reporter);
standardTestCases(reporter);
if (false) QuadraticIntersection_IntersectionFinder();
if (false) QuadraticIntersection_PointFinder();
}
-
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsQuadIntersectionTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsQuadIntersectionOneOffTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsQuadIntersectionCoincidenceOneOffTest)
#include "SkPathOpsQuad.h"
#include "SkReduceOrder.h"
#include "Test.h"
+#include "TestClassDef.h"
static struct lineQuad {
SkDQuad quad;
}
}
-static void PathOpsQuadLineIntersectionOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsQuadLineIntersectionOneOff, reporter) {
testOneOffs(reporter);
}
-static void PathOpsQuadLineIntersectionTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsQuadLineIntersection, reporter) {
for (size_t index = 0; index < lineQuadTests_count; ++index) {
int iIndex = static_cast<int>(index);
const SkDQuad& quad = lineQuadTests[index].quad;
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionOneOffTest)
#include "SkPathOpsLine.h"
#include "SkPathOpsQuad.h"
#include "SkReduceOrder.h"
+#include "TestClassDef.h"
static int doIntersect(SkIntersections& intersections, const SkDQuad& quad, const SkDLine& line,
bool& flipped) {
}
}
-static void PathOpsQuadLineIntersectionThreadedTest(skiatest::Reporter* reporter)
-{
+DEF_TEST(PathOpsQuadLineIntersectionThreaded, reporter) {
int threadCount = initializeTests(reporter, "testQuadLineIntersect");
PathOpsThreadedTestRunner testRunner(reporter, threadCount);
for (int a = 0; a < 16; ++a) {
finish:
testRunner.render();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionThreadedTest)
#include "SkDQuadImplicit.h"
#include "SkPathOpsQuad.h"
#include "Test.h"
+#include "TestClassDef.h"
static bool point_on_parameterized_curve(const SkDQuad& quad, const SkDPoint& point) {
SkDQuadImplicit q(quad);
static const size_t quadratics_count = SK_ARRAY_COUNT(quadratics);
-static void PathOpsQuadImplicitTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsQuadImplicit, reporter) {
// split large quadratic
// compare original, parts, to see if the are coincident
for (size_t index = 0; index < quadratics_count; ++index) {
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsQuadImplicitTest)
#include "SkPathOpsRect.h"
#include "SkReduceOrder.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkDQuad testSet[] = {
{{{1, 1}, {2, 2}, {1, 1.000003}}},
}
}
-static void PathOpsReduceOrderQuadTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsReduceOrderQuad, reporter) {
oneOffTest(reporter);
standardTestCases(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsReduceOrderQuadTest)
*/
#include "PathOpsExtendedTest.h"
#include "PathOpsThreadedCommon.h"
+#include "TestClassDef.h"
static void testSimplifyDegeneratesMain(PathOpsThreadState* data) {
SkASSERT(data);
}
}
-static void PathOpsSimplifyDegeneratesThreadedTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSimplifyDegeneratesThreaded, reporter) {
int threadCount = initializeTests(reporter, "testDegenerates");
PathOpsThreadedTestRunner testRunner(reporter, threadCount);
for (int a = 0; a < 16; ++a) {
finish:
testRunner.render();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsSimplifyDegeneratesThreadedTest)
#include "SkPath.h"
#include "SkPoint.h"
#include "Test.h"
+#include "TestClassDef.h"
static const SkPoint nonFinitePts[] = {
{ SK_ScalarInfinity, 0 },
reporter->bumpTestCount();
}
-static void PathOpsSimplifyFailTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSimplifyFail, reporter) {
for (int index = 0; index < (int) (13 * nonFinitePtsCount * finitePtsCount); ++index) {
failOne(reporter, index);
}
}
}
-static void PathOpsSimplifyFailOneTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSimplifyFailOne, reporter) {
int index = 0;
failOne(reporter, index);
}
-static void PathOpsSimplifyDontFailOneTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSimplifyDontFailOne, reporter) {
int index = 6;
dontFailOne(reporter, index);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsSimplifyFailTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsSimplifyFailOneTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsSimplifyDontFailOneTest)
*/
#include "PathOpsExtendedTest.h"
#include "PathOpsThreadedCommon.h"
+#include "TestClassDef.h"
static void testSimplifyQuadsMain(PathOpsThreadState* data)
{
}
}
-static void PathOpsSimplifyQuadsThreadedTest(skiatest::Reporter* reporter)
-{
+DEF_TEST(PathOpsSimplifyQuadsThreaded, reporter) {
int threadCount = initializeTests(reporter, "testQuads");
PathOpsThreadedTestRunner testRunner(reporter, threadCount);
int a = 0;
finish:
testRunner.render();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsSimplifyQuadsThreadedTest)
*/
#include "PathOpsExtendedTest.h"
#include "PathOpsThreadedCommon.h"
+#include "TestClassDef.h"
static void testSimplifyQuadralateralsMain(PathOpsThreadState* data)
{
}
}
-static void PathOpsSimplifyQuadralateralsThreadedTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSimplifyQuadralateralsThreaded, reporter) {
int threadCount = initializeTests(reporter, "testQuadralaterals");
PathOpsThreadedTestRunner testRunner(reporter, threadCount);
for (int a = 0; a < 16; ++a) {
finish:
testRunner.render();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsSimplifyQuadralateralsThreadedTest)
*/
#include "PathOpsExtendedTest.h"
#include "PathOpsThreadedCommon.h"
+#include "TestClassDef.h"
// four rects, of four sizes
// for 3 smaller sizes, tall, wide
}
}
-static void PathOpsSimplifyRectsThreadedTest(skiatest::Reporter* reporter)
-{
+DEF_TEST(PathOpsSimplifyRectsThreaded, reporter) {
int threadCount = initializeTests(reporter, "testLine");
PathOpsThreadedTestRunner testRunner(reporter, threadCount);
for (int a = 0; a < 8; ++a) { // outermost
finish:
testRunner.render();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsSimplifyRectsThreadedTest)
* found in the LICENSE file.
*/
#include "PathOpsExtendedTest.h"
+#include "TestClassDef.h"
#define TEST(name) { name, #name }
static bool runReverse = false;
static void (*stopTest)(skiatest::Reporter* ) = 0;
-static void PathOpsSimplifyTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSimplify, reporter) {
#ifdef SK_DEBUG
SkPathOpsDebug::gMaxWindSum = 4;
SkPathOpsDebug::gMaxWindValue = 4;
SkPathOpsDebug::gMaxWindValue = SK_MaxS32;
#endif
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsSimplifyTest)
*/
#include "PathOpsExtendedTest.h"
#include "PathOpsThreadedCommon.h"
+#include "TestClassDef.h"
static void testSimplifyTrianglesMain(PathOpsThreadState* data) {
SkASSERT(data);
}
}
-static void PathOpsSimplifyTrianglesThreadedTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSimplifyTrianglesThreaded, reporter) {
int threadCount = initializeTests(reporter, "testTriangles");
PathOpsThreadedTestRunner testRunner(reporter, threadCount);
for (int a = 0; a < 15; ++a) {
finish:
testRunner.render();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsSimplifyTrianglesThreadedTest)
#include "SkThreadPool.h"
#include "SkTime.h"
#include "Test.h"
+#include "TestClassDef.h"
#ifdef SK_BUILD_FOR_WIN
#define PATH_SLASH "\\"
}
}
-static void PathOpsSkpClipTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSkpClip, reporter) {
if (!initTest()) {
return;
}
(void) doOneDir(data);
}
-static void PathOpsSkpClipThreadedTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSkpClipThreaded, reporter) {
if (!initTest()) {
return;
}
encodeFound(reporter, state);
}
-static void PathOpsSkpClipOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSkpClipOneOff, reporter) {
if (!initTest()) {
return;
}
state.fTestStep = kEncodeFiles;
state.testOne();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsSkpClipTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsSkpClipOneOffTest)
-
-DEFINE_TESTCLASS_SHORT(PathOpsSkpClipThreadedTest)
*/
#include "PathOpsExtendedTest.h"
+#include "TestClassDef.h"
+
#define TEST(name) { name, #name }
static void skpcheeseandburger_com225(skiatest::Reporter* reporter) {
static bool runReverse = false;
static void (*stopTest)(skiatest::Reporter* ) = 0;
-static void PathOpsSkpTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsSkp, reporter) {
#if DEBUG_SHOW_TEST_NAME
strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
#endif
RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse);
}
-
-#include "TestClassDef.h"
-
-DEFINE_TESTCLASS_SHORT(PathOpsSkpTest)
*/
#include "PathOpsTestCommon.h"
#include "Test.h"
+#include "TestClassDef.h"
static const double roughlyTests[][2] = {
{5.0402503619650929e-005, 4.3178054475078825e-005}
static const size_t roughlyTestsCount = SK_ARRAY_COUNT(roughlyTests);
-static void PathOpsRoughlyTest(skiatest::Reporter* reporter) {
+DEF_TEST(PathOpsRoughly, reporter) {
for (size_t index = 0; index < roughlyTestsCount; ++index) {
bool equal = RoughlyEqualUlps(roughlyTests[index][0], roughlyTests[index][1]);
REPORTER_ASSERT(reporter, equal);
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(PathOpsRoughlyTest)
#include "SkThreadPool.h"
#include "SkTime.h"
#include "Test.h"
+#include "TestClassDef.h"
#ifdef SK_BUILD_FOR_WIN
#define PATH_SLASH "\\"
#define PATH_SLASH "/"
#define IN_DIR "/usr/local/google/home/caryclark" PATH_SLASH "9-30-13-skp"
#define OUT_DIR "/media/01CD75512A7F9EE0/4" PATH_SLASH
- #define LINE_FEED \n"
+ #define LINE_FEED "\n"
#endif
#define PATH_STR_SIZE 512
return make_out_dirs();
}
-static void SkpSkGrTest(skiatest::Reporter* reporter) {
+DEF_TEST(SkpSkGr, reporter) {
SkTArray<TestResult, true> errors;
if (!initTest()) {
return;
SkDebugf("#%d\n", testCount);
}
}
- skipOver:
- reporter->bumpTestCount();
+ skipOver:
+ reporter->bumpTestCount();
checkEarlyExit:
if (1 && testCount == 20) {
break;
data->fReporter->bumpTestCount();
}
-static void SkpSkGrThreadedTest(skiatest::Reporter* reporter) {
+DEF_TEST(SkpSkGrThreaded, reporter) {
if (!initTest()) {
return;
}
}
}
-static void SkpSkGrOneOffTest(skiatest::Reporter* reporter) {
+DEF_TEST(SkpSkGrOneOff, reporter) {
if (!initTest()) {
return;
}
TestResult::Test(dirIndex, filename.c_str(), kCompareBits, reporter->verbose());
TestResult::Test(dirIndex, filename.c_str(), kEncodeFiles, reporter->verbose());
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS_SHORT(SkpSkGrTest)
-
-DEFINE_TESTCLASS_SHORT(SkpSkGrOneOffTest)
-
-DEFINE_TESTCLASS_SHORT(SkpSkGrThreadedTest)
e.g.
#include "TestClassDef.h"
- DEFINE_TESTCLASS_SHORT(MyTestFunction)
- where MyTestFunction is declared as:
-
- static void MyTestFunction(skiatest::Reporter* reporter) {
+ DEF_TEST(some_test_name, r) {
+ ...
+ REPORTER_ASSERT(r, x == 15);
}
*/
-#define DEFINE_TESTCLASS_SHORT(function) \
- namespace skiatest { \
- class function##Class : public Test { \
- public: \
- static Test* Factory(void*) { return SkNEW(function##Class); } \
- protected: \
- virtual void onGetName(SkString* name) SK_OVERRIDE { name->set(#function); } \
- virtual void onRun(Reporter* reporter) SK_OVERRIDE { function(reporter); } \
- }; \
- static TestRegistry gReg_##function##Class(function##Class::Factory); \
- }
+#define DEF_TEST(name, reporter) \
+ static void name(skiatest::Reporter* reporter); \
+ namespace skiatest { \
+ class name##Class : public Test { \
+ public: \
+ static Test* Factory(void*) { return SkNEW(name##Class); } \
+ protected: \
+ virtual void onGetName(SkString* name) SK_OVERRIDE { name->set(#name); } \
+ virtual void onRun(Reporter* reporter) SK_OVERRIDE { name(reporter); } \
+ }; \
+ static TestRegistry gReg_##name##Class(name##Class::Factory); \
+ } \
+ static void name(skiatest::Reporter* reporter)
#define DEFINE_GPUTESTCLASS(uiname, classname, function) \
namespace skiatest { \
}; \
static TestRegistry gReg_##classname(classname::Factory); \
}
-
-
-// Yet shorter way to define a test. E.g.
-//
-// DEF_TEST(some_test_name, r) {
-// ...
-// REPORTER_ASSERT(r, x == 15);
-// }
-#define DEF_TEST(name, reporter) \
- static void name(skiatest::Reporter* reporter); \
- DEFINE_TESTCLASS_SHORT(name) \
- static void name(skiatest::Reporter* reporter)