You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-03 00:26:59 +02:00
35 lines
1.5 KiB
C
35 lines
1.5 KiB
C
![]() |
/***********************************************************************************************************************************
|
||
|
Test Exit Routines
|
||
|
***********************************************************************************************************************************/
|
||
|
#include "config/config.h"
|
||
|
|
||
|
/***********************************************************************************************************************************
|
||
|
Test Run
|
||
|
***********************************************************************************************************************************/
|
||
|
void testRun()
|
||
|
{
|
||
|
// *****************************************************************************************************************************
|
||
|
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();
|
||
|
}
|
||
|
}
|