Go to the source code of this file.
◆ DEF_TEST() [1/3]
Definition at line 32 of file PathOpsDVectorTest.cpp.
32 {
33 for (
size_t index = 0; index <
tests_count - 1; ++index) {
40 v2 -=
static_cast<decltype(
v2)&
>(
v2);
43 v1 /= 2;
44 v1 *= 2;
51 double v1Dot = v1.
dot(v1);
54 double v1Cross = v1.
cross(v1);
56 }
57}
static const size_t tests_count
static const SkDPoint tests[]
bool ValidVector(const SkDVector &v)
bool approximately_equal(double x, double y)
#define REPORTER_ASSERT(r, cond,...)
SIN Vec< N, float > sqrt(const Vec< N, float > &x)
double cross(const SkDVector &a) const
SkVector asSkVector() const
double dot(const SkDVector &a) const
double lengthSquared() const
◆ DEF_TEST() [2/3]
DEF_TEST |
( |
SkDVector_normalize |
, |
|
|
reporter |
|
|
) |
| |
Definition at line 59 of file PathOpsDVectorTest.cpp.
59 {
60
61 auto assertDoublesEqual = [&](
double left,
double right) {
63 };
67 assertDoublesEqual(first.fX, 0.332820);
68 assertDoublesEqual(first.fY, 0.942990);
69
73 assertDoublesEqual(second.fX, 0.455111);
74 assertDoublesEqual(second.fY, -0.890435);
75}
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
◆ DEF_TEST() [3/3]
DEF_TEST |
( |
SkDVector_normalize_infinity_and_nan |
, |
|
|
reporter |
|
|
) |
| |
Definition at line 77 of file PathOpsDVectorTest.cpp.
77 {
78
84
87 second.normalize();
91}
static float max(float r, float g, float b)
◆ tests
Initial value:= {
{0, 0},
{1, 0},
{0, 1},
{2, 1},
{1, 2},
{1, 1},
{2, 2}
}
Definition at line 20 of file PathOpsDVectorTest.cpp.
◆ tests_count
const size_t tests_count = std::size(tests) |
|
static |