Skip to content

Commit

Permalink
Merge c9348c9 into 6feb1c7
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfedel committed Feb 14, 2020
2 parents 6feb1c7 + c9348c9 commit b5b6ef4
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 2 deletions.
2 changes: 0 additions & 2 deletions modules/database/src/std/rec/seqRecord.c
Expand Up @@ -156,8 +156,6 @@ static long process(struct dbCommon *pcommon)
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);
return asyncFinish(prec);
}
if (grpn == 0)
return asyncFinish(prec);

lmask = 1 << grpn;
}
Expand Down
7 changes: 7 additions & 0 deletions modules/database/test/std/rec/Makefile
Expand Up @@ -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
Expand Down
55 changes: 55 additions & 0 deletions modules/database/test/std/rec/seqTest.c
@@ -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 changes: 39 additions & 0 deletions modules/database/test/std/rec/seqTest.db
@@ -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"){
}

0 comments on commit b5b6ef4

Please sign in to comment.