Add a test to record seq in "Specified" mode
This commit is contained in:
committed by
Michael Davidsaver
parent
8668cc1267
commit
d82529058a
@@ -77,6 +77,13 @@ testHarness_SRCS += softTest.c
|
||||
TESTFILES += ../softTest.db
|
||||
TESTS += softTest
|
||||
|
||||
TESTPROD_HOST += seqTest
|
||||
seqTest_SRCS += seqTest.c
|
||||
seqTest_SRCS += recTestIoc_registerRecordDeviceDriver.cpp
|
||||
testHarness_SRCS += seqTest.c
|
||||
TESTFILES += ../seqTest.db
|
||||
TESTS += seqTest
|
||||
|
||||
TARGETS += $(COMMON_DIR)/asTestIoc.dbd
|
||||
DBDDEPENDS_FILES += asTestIoc.dbd$(DEP)
|
||||
asTestIoc_DBD += base.dbd
|
||||
|
||||
55
modules/database/test/std/rec/seqTest.c
Normal file
55
modules/database/test/std/rec/seqTest.c
Normal file
@@ -0,0 +1,55 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2020 Gabriel Fedel
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#include "dbUnitTest.h"
|
||||
#include "testMain.h"
|
||||
#include "errlog.h"
|
||||
#include "dbAccess.h"
|
||||
#include <epicsThread.h>
|
||||
|
||||
void recTestIoc_registerRecordDeviceDriver(struct dbBase *);
|
||||
|
||||
/*
|
||||
* This test verifies the behavior of seq using Specified for SELM
|
||||
* The behavior should be the same for all the DOLx
|
||||
* */
|
||||
static
|
||||
void testSeqSpecified(void){
|
||||
int i;
|
||||
for (i=0; i < 16; i++) {
|
||||
testdbPutFieldOk("seq0.SELN", DBR_USHORT, i);
|
||||
|
||||
testdbPutFieldOk("ai0", DBR_LONG, 0);
|
||||
|
||||
testdbPutFieldOk("seq0.PROC", DBR_USHORT, 1);
|
||||
|
||||
testSyncCallback();
|
||||
testdbGetFieldEqual("ai0", DBR_LONG, i+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MAIN(eventTest) {
|
||||
testPlan(4*16);
|
||||
|
||||
testdbPrepare();
|
||||
|
||||
testdbReadDatabase("recTestIoc.dbd", NULL, NULL);
|
||||
recTestIoc_registerRecordDeviceDriver(pdbbase);
|
||||
|
||||
testdbReadDatabase("seqTest.db", NULL, NULL);
|
||||
|
||||
eltc(0);
|
||||
testIocInitOk();
|
||||
eltc(1);
|
||||
|
||||
testSeqSpecified();
|
||||
|
||||
testIocShutdownOk();
|
||||
testdbCleanup();
|
||||
|
||||
return testDone();
|
||||
}
|
||||
39
modules/database/test/std/rec/seqTest.db
Normal file
39
modules/database/test/std/rec/seqTest.db
Normal file
@@ -0,0 +1,39 @@
|
||||
record(seq, "seq0"){
|
||||
field(SELM, "Specified")
|
||||
field(DOL0, "1")
|
||||
field(DOL1, "2")
|
||||
field(DOL2, "3")
|
||||
field(DOL3, "4")
|
||||
field(DOL4, "5")
|
||||
field(DOL5, "6")
|
||||
field(DOL6, "7")
|
||||
field(DOL7, "8")
|
||||
field(DOL8, "9")
|
||||
field(DOL9, "10")
|
||||
field(DOLA, "11")
|
||||
field(DOLB, "12")
|
||||
field(DOLC, "13")
|
||||
field(DOLD, "14")
|
||||
field(DOLE, "15")
|
||||
field(DOLF, "16")
|
||||
field(LNK0, "ai0")
|
||||
field(LNK1, "ai0")
|
||||
field(LNK2, "ai0")
|
||||
field(LNK3, "ai0")
|
||||
field(LNK4, "ai0")
|
||||
field(LNK5, "ai0")
|
||||
field(LNK6, "ai0")
|
||||
field(LNK7, "ai0")
|
||||
field(LNK8, "ai0")
|
||||
field(LNK9, "ai0")
|
||||
field(LNKA, "ai0")
|
||||
field(LNKB, "ai0")
|
||||
field(LNKC, "ai0")
|
||||
field(LNKD, "ai0")
|
||||
field(LNKE, "ai0")
|
||||
field(LNKF, "ai0")
|
||||
|
||||
}
|
||||
record(ai, "ai0"){
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user