void ShapeOps4x4RectsThreaded_Test(int& testsRun)
{
    SkDebugf("%s\n", __FUNCTION__);
#ifdef SK_DEBUG
    gDebugMaxWindSum = 4;
    gDebugMaxWindValue = 4;
#endif
    const char testLineStr[] = "testOp";
    initializeTests(testLineStr, sizeof(testLineStr));
    int testsStart = testsRun;
    for (int a = 0; a < 6; ++a) { // outermost
        for (int b = a + 1; b < 7; ++b) {
            for (int c = 0 ; c < 6; ++c) {
                for (int d = c + 1; d < 7; ++d) {
                    testsRun += dispatchTest4(testShapeOps4x4RectsMain, a, b, c, d);
                }
                if (!gRunTestsInOneThread) SkDebugf(".");
            }
            if (!gRunTestsInOneThread) SkDebugf("%d", b);
        }
        if (!gRunTestsInOneThread) SkDebugf("\n%d", a);
    }
    testsRun += waitForCompletion();
    SkDebugf("%s tests=%d total=%d\n", __FUNCTION__, testsRun - testsStart, testsRun);
}
void Simplify4x4QuadraticsThreaded_Test(int& testsRun)
{
    SkDebugf("%s\n", __FUNCTION__);
#ifdef SK_DEBUG
    gDebugMaxWindSum = 4; // FIXME: 3?
    gDebugMaxWindValue = 4;
#endif
    const char testStr[] = "testQuadratic";
    initializeTests(testStr, sizeof(testStr));
    int testsStart = testsRun;
    int a = 0;
#define SKIP_A 0
#if SKIP_A
    a = 2;
#endif
    for (; a < 16; ++a) {
        for (int b = a ; b < 16; ++b) {
            for (int c = b ; c < 16; ++c) {
                for (int d = c; d < 16; ++d) {
                    testsRun += dispatchTest4(testSimplify4x4QuadraticsMain,
                            a, b, c, d);
                }
                if (!gRunTestsInOneThread) SkDebugf(".");
            }
            if (!gRunTestsInOneThread) SkDebugf("%d", b);
        }
        if (!gRunTestsInOneThread) SkDebugf("\n%d", a);
    }
    testsRun += waitForCompletion();
    SkDebugf("%s tests=%d total=%d\n", __FUNCTION__, testsRun - testsStart, testsRun);
}
예제 #3
0
DEF_TEST(PathOpsTightBoundsLines, reporter) {
    initializeTests(reporter, "tightBoundsLines");
    PathOpsThreadedTestRunner testRunner(reporter);
    int outerCount = reporter->allowExtendedTest() ? 100 : 1;
    for (int index = 0; index < outerCount; ++index) {
        for (int idx2 = 0; idx2 < 10; ++idx2) {
            *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
                    (&testTightBoundsLines, 0, 0, 0, 0, &testRunner));
        }
    }
    testRunner.render();
}
예제 #4
0
int main()
{
	InitializeDatabase();
	fopen_s(&f, "testResults.html", "wt");
	addPrefixToReport();
	initializeTests();
	runTests();
	fclose(f);
	CloseDatabase();
	if (!ok) return -1;
	return 0;
}
static void PathOpsSkpClipThreadedTest(skiatest::Reporter* reporter) {
    int threadCount = initializeTests(reporter, "skpClipThreadedTest");
    PathOpsThreadedTestRunner testRunner(reporter, threadCount);
    SkOSFile::Iter iter(pictDir, "skp");
    SkString filename;
    while (iter.next(&filename)) {
        if (strcmp(filename.c_str(), skipBefore) < 0) {
            continue;
        }
        *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
                (&testSkpClipMain, filename.c_str(), &testRunner));
        reporter->bumpTestCount();
    }
    testRunner.render();
}
static void PathOpsQuadLineIntersectionThreadedTest(skiatest::Reporter* reporter)
{
    int threadCount = initializeTests(reporter, "testQuadLineIntersect");
    PathOpsThreadedTestRunner testRunner(reporter, threadCount);
    for (int a = 0; a < 16; ++a) {
        for (int b = 0 ; b < 16; ++b) {
            for (int c = 0 ; c < 16; ++c) {
                *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
                                                  (&testQuadLineIntersectMain, a, b, c, 0, &testRunner));
            }
            if (!reporter->allowExtendedTest()) goto finish;
        }
    }
finish:
    testRunner.render();
}
DEF_TEST(PathOpsSimplifyRectsThreaded, reporter) {
    int threadCount = initializeTests(reporter, "testLine");
    PathOpsThreadedTestRunner testRunner(reporter, threadCount);
    for (int a = 0; a < 8; ++a) {  // outermost
        for (int b = a ; b < 8; ++b) {
            for (int c = b ; c < 8; ++c) {
                for (int d = c; d < 8; ++d) {
                        *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
                                (&testSimplify4x4RectsMain, a, b, c, d, &testRunner));
                }
                if (!reporter->allowExtendedTest()) goto finish;
            }
        }
    }
finish:
    testRunner.render();
}
예제 #8
0
DEF_TEST(PathOpsOpCubicsThreaded, reporter) {
    initializeTests(reporter, "cubicOp");
    PathOpsThreadedTestRunner testRunner(reporter);
    for (int a = 0; a < 6; ++a) {  // outermost
        for (int b = a + 1; b < 7; ++b) {
            for (int c = 0 ; c < 6; ++c) {
                for (int d = c + 1; d < 7; ++d) {
                    *testRunner.fRunnables.append() =
                            new PathOpsThreadedRunnable(&testOpCubicsMain, a, b, c, d, &testRunner);
                }
            }
            if (!reporter->allowExtendedTest()) goto finish;
        }
    }
finish:
    testRunner.render();
}
DEF_TEST(PathOpsSimplifyQuadralateralsThreaded, reporter) {
    initializeTests(reporter, "testQuadralaterals");
    PathOpsThreadedTestRunner testRunner(reporter);
    for (int a = 0; a < 16; ++a) {
        for (int b = a ; b < 16; ++b) {
            for (int c = b ; c < 16; ++c) {
                for (int d = c; d < 16; ++d) {
                    *testRunner.fRunnables.append() = new PathOpsThreadedRunnable(
                            &testSimplifyQuadralateralsMain, a, b, c, d, &testRunner);
                }
                if (!reporter->allowExtendedTest()) goto finish;
            }
        }
    }
finish:
    testRunner.render();
}
예제 #10
0
static void TestPathOpsRectsThreaded(skiatest::Reporter* reporter) {
    int threadCount = initializeTests("testOp");
    PathOpsThreadedTestRunner testRunner(reporter, threadCount);
    for (int a = 0; a < 6; ++a) {  // outermost
        for (int b = a + 1; b < 7; ++b) {
            for (int c = 0 ; c < 6; ++c) {
                for (int d = c + 1; d < 7; ++d) {
                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
                            (&testPathOpsRectsMain, a, b, c, d, &testRunner));
                }
            }
            if (!reporter->allowExtendedTest()) goto finish;
       }
    }
finish:
    testRunner.render();
}
예제 #11
0
DEF_TEST(PathOpsOpLoopsThreaded, reporter) {
    initializeTests(reporter, "loopOp");
    PathOpsThreadedTestRunner testRunner(reporter);
    for (int a = 0; a < 6; ++a) {  // outermost
        for (int b = a + 1; b < 7; ++b) {
            for (int c = 0 ; c < 6; ++c) {
                for (int d = c + 1; d < 7; ++d) {
                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
                            (&testOpLoopsMain, a, b, c, d, &testRunner));
                }
            }
            if (!reporter->allowExtendedTest()) goto finish;
        }
    }
finish:
    testRunner.render();
    ShowTestArray("loopOp");
}
DEF_TEST(PathOpsSimplifyQuadsThreaded, reporter) {
    int threadCount = initializeTests(reporter, "testQuads");
    PathOpsThreadedTestRunner testRunner(reporter, threadCount);
    int a = 0;
    for (; a < 16; ++a) {
        for (int b = a ; b < 16; ++b) {
            for (int c = b ; c < 16; ++c) {
                for (int d = c; d < 16; ++d) {
                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
                            (&testSimplifyQuadsMain, a, b, c, d, &testRunner));
                }
                if (!reporter->allowExtendedTest()) goto finish;
            }
        }
    }
finish:
    testRunner.render();
}
static void TestSimplifyQuadralateralsThreaded(skiatest::Reporter* reporter)
{
    int threadCount = initializeTests("testQuadralaterals");
    PathOpsThreadedTestRunner testRunner(reporter, threadCount);
    for (int a = 0; a < 16; ++a) {
        for (int b = a ; b < 16; ++b) {
            for (int c = b ; c < 16; ++c) {
                for (int d = c; d < 16; ++d) {
                    *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
                            (&testSimplifyQuadralateralsMain, a, b, c, d, &testRunner));
                }
                if (!reporter->allowExtendedTest()) goto finish;
            }
        }
    }
finish:
    testRunner.render();
}
예제 #14
0
DEF_TEST(PathOpsOpLoops, reporter) {
    (void) initializeTests(reporter, "cubicOp");
    PathOpsThreadState state;
    state.fReporter = reporter;
    SkBitmap bitmap;
    state.fBitmap = &bitmap;
    char pathStr[PATH_STR_SIZE];
    state.fPathStr = pathStr;
    for (state.fA = 0; state.fA < 6; ++state.fA) {  // outermost
        for (state.fB = state.fA + 1; state.fB < 7; ++state.fB) {
            for (state.fC = 0 ; state.fC < 6; ++state.fC) {
                for (state.fD = state.fC + 1; state.fD < 7; ++state.fD) {
                    testOpLoopsMain(&state);
                }
            }
            if (!reporter->allowExtendedTest()) goto finish;
        }
    }
finish:
    ShowTestArray();
}
static void PathOpsSimplifyDegeneratesThreadedTest(skiatest::Reporter* reporter) {
    int threadCount = initializeTests(reporter, "testDegenerates");
    PathOpsThreadedTestRunner testRunner(reporter, threadCount);
    for (int a = 0; a < 16; ++a) {
        int ax = a & 0x03;
        int ay = a >> 2;
        for (int b = a ; b < 16; ++b) {
            int bx = b & 0x03;
            int by = b >> 2;
            for (int c = a ; c < 16; ++c) {
                int cx = c & 0x03;
                int cy = c >> 2;
                bool abcIsATriangle = (bx - ax) * (cy - ay) != (by - ay) * (cx - ax);
                *testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
                                                  (&testSimplifyDegeneratesMain, a, b, c, abcIsATriangle,
                                                   &testRunner));
            }
            if (!reporter->allowExtendedTest()) goto finish;
        }
    }
finish:
    testRunner.render();
}