PathOpsDCubicTest.cpp revision 7839ce1af63bf12fe7b3caa866970bbbb3afb13d
1/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7#include "SkPathOpsCubic.h"
8#include "Test.h"
9
10static const SkDCubic tests[] = {
11    {{{2, 0}, {3, 1}, {2, 2}, {1, 1}}},
12    {{{3, 1}, {2, 2}, {1, 1}, {2, 0}}},
13    {{{3, 0}, {2, 1}, {3, 2}, {1, 1}}},
14};
15
16static const size_t tests_count = SK_ARRAY_COUNT(tests);
17
18static void PathOpsDCubicTest(skiatest::Reporter* reporter) {
19    for (size_t index = 0; index < tests_count; ++index) {
20        const SkDCubic& cubic = tests[index];
21        bool result = cubic.clockwise();
22        if (!result) {
23            SkDebugf("%s [%d] expected clockwise\n", __FUNCTION__, index);
24            REPORTER_ASSERT(reporter, 0);
25        }
26    }
27}
28
29#include "TestClassDef.h"
30DEFINE_TESTCLASS_SHORT(PathOpsDCubicTest)
31