diff --git a/src/ioc/db/test/Makefile b/src/ioc/db/test/Makefile index 2a7c15272..71140b316 100644 --- a/src/ioc/db/test/Makefile +++ b/src/ioc/db/test/Makefile @@ -90,10 +90,11 @@ TESTFILES += ../dbCaStatsTest.db TESTPROD_HOST += dbCaLinkTest dbCaLinkTest_SRCS += dbCaLinkTest.c +dbCaLinkTest_SRCS += dbCACTest.cpp dbCaLinkTest_SRCS += dbTestIoc_registerRecordDeviceDriver.cpp testHarness_SRCS += dbCaLinkTest.c TESTS += dbCaLinkTest -TESTFILES += ../dbCaLinkTest1.db +TESTFILES += ../dbCaLinkTest1.db ../dbCaLinkTest2.db ../dbCaLinkTest3.db scanIoTest_DBD += menuScan.dbd TESTPROD_HOST += scanIoTest diff --git a/src/ioc/db/test/dbCACTest.cpp b/src/ioc/db/test/dbCACTest.cpp new file mode 100644 index 000000000..538d343bf --- /dev/null +++ b/src/ioc/db/test/dbCACTest.cpp @@ -0,0 +1,82 @@ +/*************************************************************************\ +* Copyright (c) 2015 Brookhaven Science Assoc. as operator of Brookhaven +* National Laboratory. +* EPICS BASE is distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. + \*************************************************************************/ +/* + * Part of dbCaLinkTest, compiled seperately to avoid + * dbAccess.h vs. db_access.h conflicts + */ + +#include + +#include +#include + +#include + +#include "epicsUnitTest.h" + +#include "cadef.h" + +#define testECA(OP) if((OP)!=ECA_NORMAL) {testAbort("%s", #OP);} else {testPass("%s", #OP);} + +void putgetarray(chid chanid, double first, size_t count) +{ + testDiag("putgetarray(%f,%u)", first, (unsigned)count); + + std::vector buf(count); + for(size_t i=0; i buf2(count); + + testECA(ca_array_get(DBR_DOUBLE, count, chanid, &buf2[0])); + + testECA(ca_pend_io(1.0)); + + for(size_t i=0; ibptr; + buftarg1= ptarg1->bptr; + buftarg2= ptarg2->bptr; + + dbCaLinkTest_testCAC(); + + testIocShutdownOk(); + + testdbCleanup(); + + /* records don't cleanup after themselves + * so do here to silence valgrind + */ + free(bufsrc); + free(buftarg1); + free(buftarg2); +} + MAIN(dbCaLinkTest) { - testPlan(62); + testPlan(85); testNativeLink(); testStringLink(); testCP(); @@ -549,5 +592,6 @@ MAIN(dbCaLinkTest) testArrayLink(1,10); testArrayLink(10,10); testreTargetTypeChange(); + testCAC(); return testDone(); }