test: ensure all tests return a useful status code

These tests were all assumed to execute correctly because CTest is not
capable of parsing the TAP output and instead relies entirely on status
codes.
This commit is contained in:
Danny Robson 2017-05-22 13:55:21 +10:00
parent 8dac175558
commit 9471b9eae7
13 changed files with 28 additions and 14 deletions

View File

@ -14,5 +14,5 @@ main (int, char **) {
debug::backtrace ();
tap.noop ();
return EXIT_SUCCESS;
return tap.status ();
}

View File

@ -249,5 +249,5 @@ main (int, char**)
test_region<2> (tap);
test_region<3> (tap);
return EXIT_SUCCESS;
return tap.status ();
}

View File

@ -61,5 +61,5 @@ main (int, char**)
test_rotate (tap);
test_reverse (tap);
return 0;
return tap.status ();
}

View File

@ -46,4 +46,6 @@ main (int, char**)
tap.expect_eq (util::hsv_to_rgb (i.hsv), i.rgb, "hsv-to-rgb %s", i.name);
}
}
return tap.status ();
}

View File

@ -17,13 +17,13 @@ main (void)
static_assert (sizeof (util::point3f) == 3 * sizeof (util::point3f::value_type), "point3f is not packed");
static_assert (sizeof (util::point4f) == 4 * sizeof (util::point4f::value_type), "point4f is not packed");
util::TAP::logger t;
util::TAP::logger tap;
constexpr util::point2i p { -1, 2 };
t.expect_eq (-p, util::point2i { 1, -2 }, "unary point negation");
t.expect_eq ( p, p, "unary point addition");
t.expect (
tap.expect_eq (-p, util::point2i { 1, -2 }, "unary point negation");
tap.expect_eq ( p, p, "unary point addition");
tap.expect (
std::is_same<
bool,
decltype(!p)::value_type
@ -32,9 +32,9 @@ main (void)
);
auto vec = util::vector4f (0.5f);
t.expect_eq (vec, util::normalised (vec), "normalisation of normalised vector");
tap.expect_eq (vec, util::normalised (vec), "normalisation of normalised vector");
t.expect_eq (sum (util::vector4f::ones ()), 4.f, "elementwise summation");
tap.expect_eq (sum (util::vector4f::ones ()), 4.f, "elementwise summation");
return t.status ();
return tap.status ();
}

View File

@ -388,4 +388,6 @@ main ()
tap.expect (success, "ARC4 %zu", i);
}
return tap.status ();
}

View File

@ -47,4 +47,6 @@ main (void)
test_simple<unsigned,16,16> (tap);
test_simple<unsigned,26, 6> (tap);
test_simple<unsigned,32,32> (tap);
return tap.status ();
}

View File

@ -211,4 +211,6 @@ main (void)
CHECK_THROW("%c", conversion_error, 1u);
CHECK_THROW("%c", conversion_error, "foo");
return tap.status ();
}

View File

@ -48,4 +48,6 @@ main (int, char**)
tap.expect_eq<AABB2f, AABB2f> (small, { { 0.5f, 0.5f }, { 0.5f, 0.5f }}, "unsigned over-contract");
}
return tap.status ();
}

View File

@ -51,5 +51,5 @@ main (int, char**) {
"bsdsum checksum: %s", t.msg);
}
return EXIT_SUCCESS;
return tap.status ();
}

View File

@ -50,4 +50,6 @@ int main ()
util::exactly_equal (d_foo.b, std::get<1> (f_tuple)),
"dynamic member access after conversion to tuple");
}
return tap.status ();
}

View File

@ -31,7 +31,7 @@ main (int, char**)
{ "cubic 1 uniq", { 1, -3, 3, -1 }, { 1, nan, nan } },
};
util::TAP::logger test;
util::TAP::logger tap;
for (auto &i: CUBICS) {
std::array<float,3> s = util::polynomial::roots<3> (i.coeffs);
@ -52,8 +52,8 @@ main (int, char**)
ok = false;
}
test.expect (ok, "%s", i.name);
tap.expect (ok, "%s", i.name);
}
return 0;
return tap.status ();
}

View File

@ -55,4 +55,6 @@ main ()
tap.expect (std::is_same<dst_t, std::tuple<int>>::value, "tuple type mapping");
}
return tap.status ();
}