2018-01-17 09:15:51 -05:00
|
|
|
/***********************************************************************************************************************************
|
|
|
|
Test Exit Routines
|
|
|
|
***********************************************************************************************************************************/
|
|
|
|
#include "config/config.h"
|
|
|
|
|
|
|
|
/***********************************************************************************************************************************
|
|
|
|
Test Run
|
|
|
|
***********************************************************************************************************************************/
|
2018-01-31 18:22:25 -05:00
|
|
|
void
|
|
|
|
testRun()
|
2018-01-17 09:15:51 -05:00
|
|
|
{
|
|
|
|
// *****************************************************************************************************************************
|
|
|
|
if (testBegin("exitSafe()"))
|
|
|
|
{
|
|
|
|
cfgInit();
|
|
|
|
cfgCommandSet(cfgCmdArchivePush);
|
|
|
|
|
|
|
|
TEST_RESULT_INT(exitSafe(NULL), 0, "exit with no error")
|
|
|
|
testLogResult("P00 INFO: archive-push command end: completed successfully");
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------------
|
|
|
|
TRY_BEGIN()
|
|
|
|
{
|
|
|
|
THROW(RuntimeError, "test error message");
|
|
|
|
}
|
|
|
|
CATCH_ANY()
|
|
|
|
{
|
|
|
|
exitSafe(true);
|
|
|
|
testLogResult(
|
|
|
|
"P00 ERROR: [125]: test error message\n"
|
|
|
|
"P00 INFO: archive-push command end: aborted with exception [125]");
|
|
|
|
}
|
|
|
|
TRY_END();
|
|
|
|
}
|
|
|
|
}
|