MCPcopy Create free account
hub / github.com/DISTRHO/DPF / runTestsPerType

Function runTestsPerType

tests/Point.cpp:27–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template <typename T>
27static int runTestsPerType()
28{
29 using DGL_NAMESPACE::Point;
30
31 // basic usage
32 {
33 Point<T> p;
34 DISTRHO_ASSERT_EQUAL(p.getX(), 0, "point start X value is 0");
35 DISTRHO_ASSERT_EQUAL(p.getY(), 0, "point start Y value is 0");
36 DISTRHO_ASSERT_EQUAL(p.isZero(), true, "point start is zero");
37 DISTRHO_ASSERT_EQUAL(p.isNotZero(), false, "point start is for sure zero");
38
39 p.setX(5);
40 DISTRHO_ASSERT_EQUAL(p.getX(), 5, "point X value changed to 5");
41 DISTRHO_ASSERT_EQUAL(p.getY(), 0, "point start Y value remains 0");
42 DISTRHO_ASSERT_EQUAL(p.isZero(), false, "point after custom X is not zero");
43 DISTRHO_ASSERT_EQUAL(p.isNotZero(), true, "point after custom X is for sure not zero");
44
45 p.setY(7);
46 DISTRHO_ASSERT_EQUAL(p.getX(), 5, "point X value remains 5");
47 DISTRHO_ASSERT_EQUAL(p.getY(), 7, "point Y value changed to 7");
48 DISTRHO_ASSERT_EQUAL(p.isZero(), false, "point after custom X and Y is not zero");
49 DISTRHO_ASSERT_EQUAL(p.isNotZero(), true, "point after custom X and Y is for sure not zero");
50
51 // TODO everything else
52 }
53
54 return 0;
55}
56
57int main()
58{

Callers

nothing calls this directly

Calls 4

isZeroMethod · 0.80
isNotZeroMethod · 0.80
setXMethod · 0.80
setYMethod · 0.80

Tested by

no test coverage detected