blob: 04850de8f6aa9c77f5af4e384068f6bef5b7b82d [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
caryclark@google.comad65a3e2013-04-15 19:13:59 +000016static const size_t tests_count = SK_ARRAY_COUNT(tests);
caryclark@google.com07393ca2013-04-08 11:47:37 +000017
caryclark@google.comad65a3e2013-04-15 19:13:59 +000018static void PathOpsDCubicTest(skiatest::Reporter* reporter) {
caryclark@google.com07393ca2013-04-08 11:47:37 +000019 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"
caryclark@google.comad65a3e2013-04-15 19:13:59 +000030DEFINE_TESTCLASS_SHORT(PathOpsDCubicTest)