Remove some abort() calls

abort() doesn't benefit from the high level abstractions from FATAL_ERROR.
This commit is contained in:
est31 2015-10-26 04:13:27 +01:00
parent d69ef6acd3
commit 5f342aa015
4 changed files with 7 additions and 13 deletions

View File

@ -183,8 +183,7 @@ int main(int argc, char *argv[])
#ifndef __ANDROID__ #ifndef __ANDROID__
// Run unit tests // Run unit tests
if (cmd_args.getFlag("run-unittests")) { if (cmd_args.getFlag("run-unittests")) {
run_tests(); return run_tests();
return 0;
} }
#endif #endif

View File

@ -244,17 +244,14 @@ void* AsyncWorkerThread::run()
std::string script = getServer()->getBuiltinLuaPath() + DIR_DELIM + "init.lua"; std::string script = getServer()->getBuiltinLuaPath() + DIR_DELIM + "init.lua";
if (!loadScript(script)) { if (!loadScript(script)) {
errorstream << "execution of async base environment failed!" FATAL_ERROR("execution of async base environment failed!");
<< std::endl;
abort();
} }
int error_handler = PUSH_ERROR_HANDLER(L); int error_handler = PUSH_ERROR_HANDLER(L);
lua_getglobal(L, "core"); lua_getglobal(L, "core");
if (lua_isnil(L, -1)) { if (lua_isnil(L, -1)) {
errorstream << "Unable to find core within async environment!"; FATAL_ERROR("Unable to find core within async environment!");
abort();
} }
// Main loop // Main loop
@ -268,8 +265,7 @@ void* AsyncWorkerThread::run()
lua_getfield(L, -1, "job_processor"); lua_getfield(L, -1, "job_processor");
if (lua_isnil(L, -1)) { if (lua_isnil(L, -1)) {
errorstream << "Unable to get async job processor!" << std::endl; FATAL_ERROR("Unable to get async job processor!");
abort();
} }
luaL_checktype(L, -1, LUA_TFUNCTION); luaL_checktype(L, -1, LUA_TFUNCTION);

View File

@ -215,7 +215,7 @@ void TestGameDef::defineSomeNodes()
//// run_tests //// run_tests
//// ////
void run_tests() bool run_tests()
{ {
DSTACK(FUNCTION_NAME); DSTACK(FUNCTION_NAME);
@ -253,8 +253,7 @@ void run_tests()
<< "++++++++++++++++++++++++++++++++++++++++" << "++++++++++++++++++++++++++++++++++++++++"
<< "++++++++++++++++++++++++++++++++++++++++" << std::endl; << "++++++++++++++++++++++++++++++++++++++++" << std::endl;
if (num_modules_failed) return num_modules_failed;
abort();
} }
//// ////

View File

@ -142,6 +142,6 @@ extern content_t t_CONTENT_WATER;
extern content_t t_CONTENT_LAVA; extern content_t t_CONTENT_LAVA;
extern content_t t_CONTENT_BRICK; extern content_t t_CONTENT_BRICK;
void run_tests(); bool run_tests();
#endif #endif