From 02f36a4b31eb9c2aef897ed659229492f30afcac Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 3 Nov 2021 16:24:50 +0000 Subject: [PATCH] Make test fail with more information. --- src/test/func/release-rounding/rounding.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/test/func/release-rounding/rounding.cc b/src/test/func/release-rounding/rounding.cc index 0d9d159..305528f 100644 --- a/src/test/func/release-rounding/rounding.cc +++ b/src/test/func/release-rounding/rounding.cc @@ -15,6 +15,8 @@ int main(int argc, char** argv) UNUSED(argc); UNUSED(argv); + bool failed = false; + for (size_t size_class = 0; size_class < NUM_SIZECLASSES; size_class++) { size_t rsize = sizeclass_to_size((uint8_t)size_class); @@ -28,18 +30,22 @@ int main(int argc, char** argv) if (rounded != opt_rounded) { std::cout << "rsize " << rsize << " offset " << offset << " opt " - << opt_rounded << std::endl; - abort(); + << opt_rounded << " correct " << rounded << std::endl + << std::flush; + failed = true; } bool opt_mod_0 = is_multiple_of_sizeclass(size_class, offset); if (opt_mod_0 != mod_0) { std::cout << "rsize " << rsize << " offset " << offset << " opt_mod " - << opt_mod_0 << std::endl; - abort(); + << opt_mod_0 << " correct " << mod_0 << std::endl + << std::flush; + failed = true; } } } + if (failed) + abort(); return 0; }