dbUnitTest: testIocInitOk/testIocShutdownOk testAbort() on failure

This commit is contained in:
Michael Davidsaver
2014-07-11 10:28:54 -04:00
parent f85c3249ab
commit ebc3834661
3 changed files with 11 additions and 9 deletions
+6 -4
View File
@@ -42,14 +42,16 @@ void testdbReadDatabase(const char* file,
file, path, substitutions);
}
int testIocInitOk(void)
void testIocInitOk(void)
{
return iocBuildIsolated() || iocRun();
if(iocBuildIsolated() || iocRun())
testAbort("Failed to start up test database");
}
int testIocShutdownOk(void)
void testIocShutdownOk(void)
{
return iocShutdown();
if(iocShutdown())
testAbort("Failed to shutdown test database");
}
void testdbCleanup(void)
+2 -2
View File
@@ -29,8 +29,8 @@ epicsShareFunc void testdbPrepare(void);
epicsShareFunc void testdbReadDatabase(const char* file,
const char* path,
const char* substitutions);
epicsShareFunc int testIocInitOk(void);
epicsShareFunc int testIocShutdownOk(void);
epicsShareFunc void testIocInitOk(void);
epicsShareFunc void testIocShutdownOk(void);
epicsShareFunc void testdbCleanup(void);
/* Scalar only version.
+3 -3
View File
@@ -72,19 +72,19 @@ void cycle(void) {
testdbReadDatabase("xRecord.db", NULL, NULL);
testOk1(!testIocInitOk());
testIocInitOk();
epicsThreadMap(findCommonThread);
checkCommonThreads();
testOk1(testIocShutdownOk()==0);
testIocShutdownOk();
testdbCleanup();
}
MAIN(dbShutdownTest)
{
testPlan(14);
testPlan(10);
cycle();
cycle();