delete world;
return EXIT_SUCCESS;
- case TEST_FATAL:
case TEST_FAILURE:
- case TEST_MEMORY_ALLOCATION_FAILURE:
delete world;
return EXIT_FAILURE;
}
case TEST_SUCCESS:
break;
- case TEST_FATAL:
case TEST_FAILURE:
Out << next->name << " [ failed ]";
failed= true;
skipped= true;
goto cleanup;
- case TEST_MEMORY_ALLOCATION_FAILURE:
- test_assert(0, "Allocation failure, or unknown return");
+ default:
+ throw fatal_message("invalid return code");
}
Out << "Collection: " << next->name;
stats.success++;
break;
- case TEST_FATAL:
case TEST_FAILURE:
stats.failed++;
failed= true;
Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
break;
- case TEST_MEMORY_ALLOCATION_FAILURE:
- test_assert(0, "Memory Allocation Error");
+ default:
+ throw fatal_message("invalid return code");
}
if (test_failed(world->on_error(return_code, creators_ptr)))
{
std::cerr << e.what() << std::endl;
}
+ catch (std::bad_alloc& e)
+ {
+ std::cerr << e.what() << std::endl;
+ }
catch (...)
{
std::cerr << "Unknown exception halted execution" << std::endl;