blob: 60b92dfa84a8dd994df950b6d05c3447d348b6dc [file] [log] [blame]
caryclark@google.com07393ca2013-04-08 11:47:37 +00001/*
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 = sizeof(tests) / sizeof(tests[0]);
17
18static void DCubicTest(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("PathOpsDCubic", PathOpsDCubic, DCubicTest)