blob: 279564b7c54440ea0676380b680f8e902b5fb9d3 [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 */
caryclark@google.com8d0a5242013-07-16 16:11:16 +00007#include "PathOpsTestCommon.h"
caryclark@google.com07393ca2013-04-08 11:47:37 +00008#include "SkPathOpsCubic.h"
9#include "Test.h"
tfarina@chromium.org78e7b4e2014-01-02 21:45:03 +000010#include "TestClassDef.h"
caryclark@google.com07393ca2013-04-08 11:47:37 +000011
12static const SkDCubic tests[] = {
13 {{{2, 0}, {3, 1}, {2, 2}, {1, 1}}},
14 {{{3, 1}, {2, 2}, {1, 1}, {2, 0}}},
15 {{{3, 0}, {2, 1}, {3, 2}, {1, 1}}},
16};
17
caryclark@google.comad65a3e2013-04-15 19:13:59 +000018static const size_t tests_count = SK_ARRAY_COUNT(tests);
caryclark@google.com07393ca2013-04-08 11:47:37 +000019
tfarina@chromium.org78e7b4e2014-01-02 21:45:03 +000020DEF_TEST(PathOpsDCubic, reporter) {
caryclark@google.com07393ca2013-04-08 11:47:37 +000021 for (size_t index = 0; index < tests_count; ++index) {
22 const SkDCubic& cubic = tests[index];
caryclark@google.com8d0a5242013-07-16 16:11:16 +000023 SkASSERT(ValidCubic(cubic));
caryclark@google.com07393ca2013-04-08 11:47:37 +000024 bool result = cubic.clockwise();
25 if (!result) {
26 SkDebugf("%s [%d] expected clockwise\n", __FUNCTION__, index);
27 REPORTER_ASSERT(reporter, 0);
28 }
29 }
30}