Make test fail with more information.
This commit is contained in:
committed by
Matthew Parkinson
parent
cf89339762
commit
02f36a4b31
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user