Пример #1
0
void TestCanvas::test(GiCanvas* canvas, int bits, int n, bool randStyle)
{
    s_randStyle = randStyle;
    if ((bits & 0x400) == 0 || !s_inited) {
        initRand();
    }
    
    if (bits & 0x01)
        testRect(canvas, n);
    if (bits & 0x02)
        testLine(canvas, n);
    if (bits & 0x04)
        testTextAt(canvas, n);
    if (bits & 0x08)
        testEllipse(canvas, n);
    if (bits & 0x10)
        testQuadBezier(canvas, n);
    if (bits & 0x20)
        testCubicBezier(canvas, n);
    if (bits & 0x40)
        testPolygon(canvas, n);
    if (bits & 0x80)
        canvas->clearRect(100, 100, 200, 200);
    if (bits & 0x100)
        testClipPath(canvas, n);
    if (bits & 0x200)
        testHandle(canvas, n);
    if (bits & 0x400)
        testDynCurves(canvas);
}
Пример #2
0
void TestCanvas::test(GiCanvas* canvas, int bits, int n, bool randStyle)
{
    s_randStyle = randStyle;
    if ((bits & kDynCurves) == 0 || !s_inited) {
        initRand();
    }
    
    if (bits & kRect)
        testRect(canvas, n * 2);
    if (bits & kLine)
        testLine(canvas, n * 2);
    if (bits & kTextAt)
        testTextAt(canvas, n);
    if (bits & kEllipse)
        testEllipse(canvas, n * 2);
    if (bits & kQuadBezier)
        testQuadBezier(canvas, n);
    if (bits & kCubicBezier)
        testCubicBezier(canvas, n);
    if (bits & kPolygon)
        testPolygon(canvas, n);
    if (bits & kClearRect)
        canvas->clearRect(100, 100, 200, 200);
    if (bits & kClipPath)
        testClipPath(canvas, n);
    if (bits & kHandle)
        testHandle(canvas, n);
    if (bits & kDynCurves)
        testDynCurves(canvas);
}
Пример #3
0
void ParametricCurveTests::runTests(int &numTestsRun, int &numTestsPassed)
{
  setup();
  if (testGradientWrapper())
  {
    numTestsPassed++;
  }
  numTestsRun++;
  teardown();

  setup();
  if (testTransfiniteInterpolant())
  {
    numTestsPassed++;
  }
  numTestsRun++;
  teardown();

  setup();
  if (testCircularArc())
  {
    numTestsPassed++;
  }
  numTestsRun++;
  teardown();

  setup();
  if (testLine())
  {
    numTestsPassed++;
  }
  numTestsRun++;
  teardown();

  setup();
  if (testBubble())
  {
    numTestsPassed++;
  }
  numTestsRun++;
  teardown();

  setup();
  if (testProjectionBasedInterpolation())
  {
    numTestsPassed++;
  }
  numTestsRun++;
  teardown();

  setup();
  if (testPolygon())
  {
    numTestsPassed++;
  }
  numTestsRun++;
  teardown();

  setup();
  if (testParametricCurveRefinement())
  {
    numTestsPassed++;
  }
  numTestsRun++;
  teardown();
}