test regressLinkSevr

This commit is contained in:
Michael Davidsaver
2021-08-29 07:34:53 -07:00
parent f6e8a75026
commit 7ce69155a9
3 changed files with 61 additions and 1 deletions
+1
View File
@@ -129,6 +129,7 @@ regressTest_SRCS += regressTest_registerRecordDeviceDriver.cpp
TESTFILES += $(COMMON_DIR)/regressTest.dbd ../regressArray1.db ../regressHex.db ../regressLinkMS.db
TESTFILES += ../badCaLink.db
TESTFILES += ../regressLongCalc.db
TESTFILES += ../regressLinkSevr.db
TESTS += regressTest
TARGETS += $(COMMON_DIR)/simmTest.dbd
@@ -0,0 +1,18 @@
record(ai, "ai") {}
record(stringin, "si1") {
field(INP, "ai.SEVR")
field(FLNK, "li1")
}
record(longin, "li1") {
field(INP, "ai.SEVR")
field(FLNK, "si2")
}
record(stringin, "si2") {
field(INP, "ai.SEVR CA")
field(FLNK, "li2")
}
record(longin, "li2") {
field(INP, "ai.SEVR CA")
}
+42 -1
View File
@@ -5,6 +5,8 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#define EPICS_DBCA_PRIVATE_API
#include <dbUnitTest.h>
#include <testMain.h>
#include <dbAccess.h>
@@ -165,13 +167,52 @@ void testLongCalc(void)
testdbCleanup();
}
/* https://github.com/epics-base/epics-base/issues/183 */
static
void testLinkSevr(void)
{
dbChannel *chan;
startRegressTestIoc("regressLinkSevr.db");
dbCaSync(); /* wait for CA links to connect */
dbCaSync(); /* wait for initial update */
chan = dbChannelCreate("ai.SEVR");
if(!chan)
testAbort("Can't create channel for ai.SEVR");
testOk1(!dbChannelOpen(chan));
#define testType(FN, TYPE) testOk(FN(chan)==TYPE, #FN "() -> (%d) == " #TYPE " (%d)", FN(chan), TYPE)
testType(dbChannelExportType, DBF_ENUM);
testType(dbChannelFieldType, DBF_MENU);
testType(dbChannelFinalFieldType, DBF_ENUM);
#undef testType
dbChannelDelete(chan);
testdbGetFieldEqual("ai.SEVR", DBF_LONG, INVALID_ALARM);
testdbGetFieldEqual("ai.SEVR", DBF_STRING, "INVALID");
testdbPutFieldOk("si1.PROC", DBF_LONG, 1);
testdbGetFieldEqual("si1", DBF_STRING, "INVALID");
testdbGetFieldEqual("li1", DBF_LONG, INVALID_ALARM);
testTodoBegin("Not working");
testdbGetFieldEqual("si2", DBF_STRING, "INVALID");
testTodoEnd();
testdbGetFieldEqual("li2", DBF_LONG, INVALID_ALARM);
testIocShutdownOk();
testdbCleanup();
}
MAIN(regressTest)
{
testPlan(43);
testPlan(54);
testArrayLength1();
testHexConstantLinks();
testLinkMS();
testCADisconn();
testLongCalc();
testLinkSevr();
return testDone();
}