Commit ca9ac57d authored by Ben Huber's avatar Ben Huber

allow UnitTests to use the swap. not allowing this can cause bad_allocs on...

allow UnitTests to use the swap. not allowing this can cause bad_allocs on medium sized allocations due to soft limits set by the OS for non-priviledged executables
parent 6dbf224e
Pipeline #1360 passed with stages
in 17 minutes and 36 seconds
......@@ -84,7 +84,7 @@ namespace xerus { namespace misc {
std::cerr << "| Test has thrown an uncaught xerus::generic_error():" << std::endl;
std::cerr << e.what() << std::endl;
::xerus::misc::UnitTest::passed = false;
}/* catch (const std::exception &e) {
} catch (const std::exception &e) {
std::cout << u8"\033[1;31m\u2717 \033[0m" << std::endl;
std::cerr << "| Test has thrown an uncaught std::exception:" << std::endl;
std::cerr << e.what() << std::endl;
......@@ -93,7 +93,7 @@ namespace xerus { namespace misc {
std::cout << u8"\033[1;31m\u2717 \033[0m" << std::endl;
std::cerr << "| Test has thrown an uncaught unknown exception..." << std::endl;
::xerus::misc::UnitTest::passed = false;
}*/
}
std::chrono::microseconds::rep time = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - start).count();
if (::xerus::misc::UnitTest::passed) {
......@@ -141,9 +141,6 @@ int main(int argc, char* argv[]) {
signal(SIGILL,xerus::misc::internal::catch_signals);
signal(SIGSEGV,xerus::misc::internal::catch_signals);
// Prevent swap usage
mlockall(MCL_CURRENT | MCL_FUTURE);
//Calculate complete time
std::chrono::high_resolution_clock::time_point startTime = std::chrono::high_resolution_clock::now();
......@@ -153,8 +150,8 @@ int main(int argc, char* argv[]) {
std::cout << "###############################################################################" << std::endl;
// No unittests defined (ie. the map tests does not exist!)
if (!xerus::misc::UnitTest::tests) {
std::cout << "no unittests defined.\n";
std::cout << "use the macro UNIT_TEST(group, testname, ...) to define unittests inside the sourcecode." << std::endl;
std::cout << "No unittests defined.\n";
std::cout << "Create xerus::misc::UnitTest objects to define unittests inside the sourcecode." << std::endl;
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment