Skip to content

Commit

Permalink
conditional test of registerAllRecordDeviceDrivers()
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Jun 29, 2020
1 parent 0cae728 commit e212262
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions modules/database/test/std/rec/Makefile
Expand Up @@ -37,6 +37,9 @@ TESTS += arrayOpTest

TESTPROD_HOST += recMiscTest
recMiscTest_SRCS += recMiscTest.c
ifeq (NO,$(STATIC_BUILD))
recMiscTest_CFLAGS += -DLINK_DYNAMIC
endif
recMiscTest_SRCS += recTestIoc_registerRecordDeviceDriver.cpp
testHarness_SRCS += recMiscTest.c
TESTFILES += ../recMiscTest.db
Expand Down
12 changes: 9 additions & 3 deletions modules/database/test/std/rec/recMiscTest.c
Expand Up @@ -63,16 +63,22 @@ void recTestIoc_registerRecordDeviceDriver(struct dbBase *);

MAIN(recMiscTest)
{
testPlan(10);
testPlan(12);

testdbPrepare();

testdbReadDatabase("recTestIoc.dbd", NULL, NULL);

#ifdef LINK_DYNAMIC
/* A smoke test of registerAllRecordDeviceDrivers to check for idempotence */
registerAllRecordDeviceDrivers(pdbbase);
testOk1(registerAllRecordDeviceDrivers(pdbbase)==0);
#else
testSkip(2, "only testing registerAllRecordDeviceDrivers() with dynamic linking");
#endif
recTestIoc_registerRecordDeviceDriver(pdbbase);
registerAllRecordDeviceDrivers(pdbbase);
#ifdef LINK_DYNAMIC
testOk1(registerAllRecordDeviceDrivers(pdbbase)==0);
#endif

testdbReadDatabase("recMiscTest.db", NULL, NULL);

Expand Down

0 comments on commit e212262

Please sign in to comment.