MCPcopy Create free account
hub / github.com/cpputest/cpputest / TEST

Function TEST

tests/CppUTest/UtestTest.cpp:61–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59static volatile double zero = 0.0;
60
61TEST(UtestShell, compareDoubles)
62{
63 double not_a_number = zero / zero;
64 double infinity = 1 / zero;
65 CHECK(doubles_equal(1.0, 1.001, 0.01));
66 CHECK(!doubles_equal(not_a_number, 1.001, 0.01));
67 CHECK(!doubles_equal(1.0, not_a_number, 0.01));
68 CHECK(!doubles_equal(1.0, 1.001, not_a_number));
69 CHECK(!doubles_equal(1.0, 1.1, 0.05));
70 CHECK(!doubles_equal(infinity, 1.0, 0.01));
71 CHECK(!doubles_equal(1.0, infinity, 0.01));
72 CHECK(doubles_equal(1.0, -1.0, infinity));
73 CHECK(doubles_equal(infinity, infinity, 0.01));
74 CHECK(doubles_equal(infinity, infinity, infinity));
75 double a = 1.2345678;
76 CHECK(doubles_equal(a, a, 0.000000001));
77}
78
79TEST(UtestShell, FailWillIncreaseTheAmountOfChecks)
80{

Callers

nothing calls this directly

Calls 15

doubles_equalFunction · 0.85
setTestFunctionMethod · 0.80
setSetupMethod · 0.80
setTeardownMethod · 0.80
hasTestFailedMethod · 0.80
verboseMethod · 0.80
asCharStringMethod · 0.80
getOutputMethod · 0.80
getRegistryMethod · 0.80
assertPrintContainsMethod · 0.80
containsMethod · 0.80

Tested by

no test coverage detected