Merge tag 'R7.0.5' into 7.0.5-troubleshoot
Base / Win2019 MSC-19 (push) Has been cancelled
Base / Win2019 MSC-19, static (push) Has been cancelled
Base / Ub-20 clang-10 C++11 (push) Has been cancelled
Base / MacOS clang-12 (push) Has been cancelled
Base / Ub-20 gcc-9 C++11, static (push) Has been cancelled
Base / Ub-20 gcc-9 + MinGW, static (push) Has been cancelled
Base / Ub-16 gcc-4.8 (push) Has been cancelled
Base / Ub-20 gcc-8 (push) Has been cancelled
Base / Ub-16 clang-9 (push) Has been cancelled
Base / Ub-20 clang-10 (push) Has been cancelled
Base / Ub-20 gcc-9 + MinGW (push) Has been cancelled
Base / Ub-20 gcc-9 + RT-4.10 (push) Has been cancelled
Base / Ub-20 gcc-9 + RT-4.9 (push) Has been cancelled
Base / Ub-16 gcc-4.9 (push) Has been cancelled

ANJ: Tagged for release

Conflicts:
	configure/os/CONFIG_SITE.Common.linuxCommon
This commit is contained in:
2021-05-05 10:30:11 +02:00
1072 changed files with 8736 additions and 2518 deletions
@@ -6,6 +6,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -6,6 +6,7 @@
* National Laboratory.
* Copyright (c) 2003 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to the Software License Agreement
* found in the file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -177,7 +178,7 @@ static void check(short dbr_type) {
/* Default: should not change anything */
testHead("Ten %s elements from rec, increment 1, full size (default)", typname);
createAndOpen(valname, "{\"arr\":{}}", "(default)", &pch, 1);
createAndOpen(valname, "{arr:{}}", "(default)", &pch, 1);
testOk(pch->final_type == valaddr.field_type,
"final type unchanged (%d->%d)", valaddr.field_type, pch->final_type);
testOk(pch->final_no_elements == valaddr.no_elements,
@@ -187,7 +188,7 @@ static void check(short dbr_type) {
dbChannelDelete(pch);
testHead("Ten %s elements from rec, increment 1, out-of-bound start parameter", typname);
createAndOpen(valname, "{\"arr\":{\"s\":-500}}", "out-of-bound start", &pch, 1);
createAndOpen(valname, "{arr:{s:-500}}", "out-of-bound start", &pch, 1);
testOk(pch->final_type == valaddr.field_type,
"final type unchanged (%d->%d)", valaddr.field_type, pch->final_type);
testOk(pch->final_no_elements == valaddr.no_elements,
@@ -196,7 +197,7 @@ static void check(short dbr_type) {
dbChannelDelete(pch);
testHead("Ten %s elements from rec, increment 1, out-of-bound end parameter", typname);
createAndOpen(valname, "{\"arr\":{\"e\":500}}", "out-of-bound end", &pch, 1);
createAndOpen(valname, "{arr:{e:500}}", "out-of-bound end", &pch, 1);
testOk(pch->final_type == valaddr.field_type,
"final type unchanged (%d->%d)", valaddr.field_type, pch->final_type);
testOk(pch->final_no_elements == valaddr.no_elements,
@@ -205,7 +206,7 @@ static void check(short dbr_type) {
dbChannelDelete(pch);
testHead("Ten %s elements from rec, increment 1, zero increment parameter", typname);
createAndOpen(valname, "{\"arr\":{\"i\":0}}", "zero increment", &pch, 1);
createAndOpen(valname, "{arr:{i:0}}", "zero increment", &pch, 1);
testOk(pch->final_type == valaddr.field_type,
"final type unchanged (%d->%d)", valaddr.field_type, pch->final_type);
testOk(pch->final_no_elements == valaddr.no_elements,
@@ -214,7 +215,7 @@ static void check(short dbr_type) {
dbChannelDelete(pch);
testHead("Ten %s elements from rec, increment 1, invalid increment parameter", typname);
createAndOpen(valname, "{\"arr\":{\"i\":-30}}", "invalid increment", &pch, 1);
createAndOpen(valname, "{arr:{i:-30}}", "invalid increment", &pch, 1);
testOk(pch->final_type == valaddr.field_type,
"final type unchanged (%d->%d)", valaddr.field_type, pch->final_type);
testOk(pch->final_no_elements == valaddr.no_elements,
@@ -224,7 +225,7 @@ static void check(short dbr_type) {
#define TEST5(Incr, Left, Right, Type) \
testHead("Five %s elements from rec, increment " #Incr ", " Type " addressing", typname); \
createAndOpen(valname, "{\"arr\":{\"s\":" #Left ",\"e\":" #Right ",\"i\":" #Incr "}}", \
createAndOpen(valname, "{arr:{s:" #Left ",e:" #Right ",i:" #Incr "}}", \
"(" #Left ":" #Incr ":" #Right ")", &pch, 1); \
testOk(pch->final_type == valaddr.field_type, \
"final type unchanged (%d->%d)", valaddr.field_type, pch->final_type); \
@@ -261,7 +262,7 @@ static void check(short dbr_type) {
#define TEST5B(Incr, Left, Right, Type) \
testHead("Five %s elements from buffer, increment " #Incr ", " Type " addressing", typname); \
createAndOpen(valname, "{\"arr\":{},\"arr\":{\"s\":" #Left ",\"e\":" #Right ",\"i\":" #Incr "}}", \
createAndOpen(valname, "{arr:{},arr:{s:" #Left ",e:" #Right ",i:" #Incr "}}", \
"(" #Left ":" #Incr ":" #Right ")", &pch, 2); \
testOk(pch->final_type == valaddr.field_type, \
"final type unchanged (%d->%d)", valaddr.field_type, pch->final_type); \
+5 -4
View File
@@ -2,6 +2,7 @@
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -147,7 +148,7 @@ MAIN(dbndTest)
testOk(!!(plug = dbFindFilter(dbnd, strlen(dbnd))), "plugin dbnd registered correctly");
testOk(!!(pch = dbChannelCreate("x.VAL{\"dbnd\":{}}")), "dbChannel with plugin dbnd (delta=0) created");
testOk(!!(pch = dbChannelCreate("x.VAL{dbnd:{}}")), "dbChannel with plugin dbnd (delta=0) created");
testOk((ellCount(&pch->filters) == 1), "channel has one plugin");
/* Start the free-list */
@@ -201,7 +202,7 @@ MAIN(dbndTest)
/* Delta = -1: pass any update */
testHead("Delta = -1: pass any update");
testOk(!!(pch = dbChannelCreate("x.VAL{\"dbnd\":{\"d\":-1.0}}")), "dbChannel with plugin dbnd (delta=-1) created");
testOk(!!(pch = dbChannelCreate("x.VAL{dbnd:{d:-1.0}}")), "dbChannel with plugin dbnd (delta=-1) created");
testOk(!(dbChannelOpen(pch)), "dbChannel with plugin dbnd opened");
pfl2 = db_create_read_log(pch);
@@ -219,7 +220,7 @@ MAIN(dbndTest)
/* Delta = absolute */
testHead("Delta = absolute");
testOk(!!(pch = dbChannelCreate("x.VAL{\"dbnd\":{\"d\":3}}")), "dbChannel with plugin dbnd (delta=3) created");
testOk(!!(pch = dbChannelCreate("x.VAL{dbnd:{d:3}}")), "dbChannel with plugin dbnd (delta=3) created");
testOk(!(dbChannelOpen(pch)), "dbChannel with plugin dbnd opened");
pfl2 = db_create_read_log(pch);
@@ -253,7 +254,7 @@ MAIN(dbndTest)
/* Delta = relative */
testHead("Delta = relative");
testOk(!!(pch = dbChannelCreate("x.VAL{\"dbnd\":{\"m\":\"rel\",\"d\":50}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{dbnd:{m:'rel',d:50}}")),
"dbChannel with plugin dbnd (mode=rel, delta=50) created");
testOk(!(dbChannelOpen(pch)), "dbChannel with plugin dbnd opened");
+9 -8
View File
@@ -4,6 +4,7 @@
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -148,20 +149,20 @@ MAIN(decTest)
"plugin '%s' registered correctly", myname);
/* N < 1 */
testOk(!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":-1}}")),
testOk(!(pch = dbChannelCreate("x.VAL{dec:{n:-1}}")),
"dbChannel with dec (n=-1) failed");
testOk(!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":0}}")),
testOk(!(pch = dbChannelCreate("x.VAL{dec:{n:0}}")),
"dbChannel with dec (n=0) failed");
/* Bad parms */
testOk(!(pch = dbChannelCreate("x.VAL{\"dec\":{}}")),
testOk(!(pch = dbChannelCreate("x.VAL{dec:{}}")),
"dbChannel with dec (no parm) failed");
testOk(!(pch = dbChannelCreate("x.VAL{\"dec\":{\"x\":true}}")),
testOk(!(pch = dbChannelCreate("x.VAL{dec:{x:true}}")),
"dbChannel with dec (x=true) failed");
/* No Decimation (N=1) */
testHead("No Decimation (n=1)");
testOk(!!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":1}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{dec:{n:1}}")),
"dbChannel with plugin dec (n=1) created");
/* Start the free-list */
@@ -191,7 +192,7 @@ MAIN(decTest)
/* Decimation (N=2) */
testHead("Decimation (n=2)");
testOk(!!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":2}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{dec:{n:2}}")),
"dbChannel with plugin dec (n=2) created");
checkAndOpenChannel(pch, plug);
@@ -221,7 +222,7 @@ MAIN(decTest)
/* Decimation (N=3) */
testHead("Decimation (n=3)");
testOk(!!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":3}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{dec:{n:3}}")),
"dbChannel with plugin dec (n=3) created");
checkAndOpenChannel(pch, plug);
@@ -251,7 +252,7 @@ MAIN(decTest)
/* Decimation (N=4) */
testHead("Decimation (n=4)");
testOk(!!(pch = dbChannelCreate("x.VAL{\"dec\":{\"n\":4}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{dec:{n:4}}")),
"dbChannel with plugin dec (n=4) created");
checkAndOpenChannel(pch, plug);
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
+10 -9
View File
@@ -2,6 +2,7 @@
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -224,19 +225,19 @@ MAIN(syncTest)
testOk(!!(red = dbStateCreate("red")), "state 'red' created successfully");
/* nonexisting state */
testOk(!(pch = dbChannelCreate("x.VAL{\"sync\":{\"m\":\"while\",\"s\":\"blue\"}}")),
testOk(!(pch = dbChannelCreate("x.VAL{sync:{m:'while',s:'blue'}}")),
"dbChannel with sync (m='while' s='blue') (nonex state) failed");
/* missing state */
testOk(!(pch = dbChannelCreate("x.VAL{\"sync\":{\"m\":\"while\"}}")),
testOk(!(pch = dbChannelCreate("x.VAL{sync:{m:'while'}}")),
"dbChannel with sync (m='while') (no state) failed");
/* missing mode */
testOk(!(pch = dbChannelCreate("x.VAL{\"sync\":{\"s\":\"red\"}}")),
testOk(!(pch = dbChannelCreate("x.VAL{sync:{s:'red'}}")),
"dbChannel with sync (s='red') (no mode) failed");
/* mode WHILE */
testHead("Mode WHILE (m='while', s='red')");
testOk(!!(pch = dbChannelCreate("x.VAL{\"sync\":{\"m\":\"while\",\"s\":\"red\"}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{sync:{m:'while',s:'red'}}")),
"dbChannel with plugin sync (m='while' s='red') created");
/* Start the free-list */
@@ -273,7 +274,7 @@ MAIN(syncTest)
/* mode UNLESS */
testHead("Mode UNLESS (m='unless', s='red')");
testOk(!!(pch = dbChannelCreate("x.VAL{\"sync\":{\"m\":\"unless\",\"s\":\"red\"}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{sync:{m:'unless',s:'red'}}")),
"dbChannel with plugin sync (m='unless' s='red') created");
checkAndOpenChannel(pch, plug);
@@ -305,7 +306,7 @@ MAIN(syncTest)
/* mode BEFORE */
testHead("Mode BEFORE (m='before', s='red')");
testOk(!!(pch = dbChannelCreate("x.VAL{\"sync\":{\"m\":\"before\",\"s\":\"red\"}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{sync:{m:'before',s:'red'}}")),
"dbChannel with plugin sync (m='before' s='red') created");
checkAndOpenChannel(pch, plug);
@@ -339,7 +340,7 @@ MAIN(syncTest)
/* mode FIRST */
testHead("Mode FIRST (m='first', s='red')");
testOk(!!(pch = dbChannelCreate("x.VAL{\"sync\":{\"m\":\"first\",\"s\":\"red\"}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{sync:{m:'first',s:'red'}}")),
"dbChannel with plugin sync (m='first' s='red') created");
checkAndOpenChannel(pch, plug);
@@ -372,7 +373,7 @@ MAIN(syncTest)
/* mode LAST */
testHead("Mode LAST (m='last', s='red')");
testOk(!!(pch = dbChannelCreate("x.VAL{\"sync\":{\"m\":\"last\",\"s\":\"red\"}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{sync:{m:'last',s:'red'}}")),
"dbChannel with plugin sync (m='last' s='red') created");
checkAndOpenChannel(pch, plug);
@@ -406,7 +407,7 @@ MAIN(syncTest)
/* mode AFTER */
testHead("Mode AFTER (m='after', s='red')");
testOk(!!(pch = dbChannelCreate("x.VAL{\"sync\":{\"m\":\"after\",\"s\":\"red\"}}")),
testOk(!!(pch = dbChannelCreate("x.VAL{sync:{m:'after',s:'red'}}")),
"dbChannel with plugin sync (m='after' s='red') created");
checkAndOpenChannel(pch, plug);
+2 -1
View File
@@ -2,6 +2,7 @@
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -73,7 +74,7 @@ MAIN(tsTest)
testOk(!!(plug = dbFindFilter(ts, strlen(ts))), "plugin ts registered correctly");
testOk(!!(pch = dbChannelCreate("x.VAL{\"ts\":{}}")), "dbChannel with plugin ts created");
testOk(!!(pch = dbChannelCreate("x.VAL{ts:{}}")), "dbChannel with plugin ts created");
testOk((ellCount(&pch->filters) == 1), "channel has one plugin");
memset(&fl, PATTERN, sizeof(fl));
@@ -4,6 +4,7 @@
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2018 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2018 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution.
\*************************************************************************/
+15 -14
View File
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2018 Andrew Johnson
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -52,9 +53,9 @@ static void testCalc()
{
dbStateId red;
testPutLongStr("io.INPUT", "{\"calc\":{"
"\"expr\":\"a\","
"\"args\":[{\"state\":\"red\"}]"
testPutLongStr("io.INPUT", "{calc:{"
"expr:'a',"
"args:[{state:'red'}]"
"}}");
if (testOk1(pinp->type == JSON_LINK))
testDiag("Link was set to '%s'", pinp->value.json.string);
@@ -77,11 +78,11 @@ static void testCalc()
dbStateId minor = dbStateCreate("minor");
epicsEnum16 stat, sevr;
testPutLongStr("io.INPUT", "{\"calc\":{"
"\"expr\":\"0\","
"\"major\":\"A\","
"\"minor\":\"B\","
"\"args\":[{\"state\":\"major\"},{\"state\":\"minor\"}]"
testPutLongStr("io.INPUT", "{calc:{"
"expr:'0',"
"major:'A',"
"minor:'B',"
"args:[{state:'major'},{state:'minor'}]"
"}}");
if (testOk1(pinp->type == JSON_LINK))
testDiag("Link was set to '%s'", pinp->value.json.string);
@@ -113,12 +114,12 @@ static void testCalc()
dbStateId red = dbStateFind("red");
dbStateId out = dbStateCreate("out");
testPutLongStr("io.OUTPUT", "{\"calc\":{"
"\"expr\":\"!a\","
"\"out\":{\"state\":\"out\"},"
"\"args\":[{\"state\":\"red\"}],"
"\"units\":\"things\","
"\"prec\":3"
testPutLongStr("io.OUTPUT", "{calc:{"
"expr:'!a',"
"out:{state:'out'},"
"args:[{state:'red'}],"
"units:'things',"
"prec:3"
"}}");
if (testOk1(pout->type == JSON_LINK))
testDiag("Link was set to '%s'", pout->value.json.string);
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2018 Andrew Johnson
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -49,7 +50,7 @@ static void testState()
red = dbStateFind("red");
testOk(!red, "No state red exists");
testdbPutFieldOk("io.INPUT", DBF_STRING, "{\"state\":\"red\"}");
testdbPutFieldOk("io.INPUT", DBF_STRING, "{state:'red'}");
if (testOk1(pinp->type == JSON_LINK))
testDiag("Link was set to '%s'", pinp->value.json.string);
red = dbStateFind("red");
@@ -63,7 +64,7 @@ static void testState()
testOk(!status, "dbGetLink succeeded (status = %ld)", status);
testOk(i16, "Got TRUE");
testdbPutFieldOk("io.INPUT", DBF_STRING, "{\"state\":\"!red\"}");
testdbPutFieldOk("io.INPUT", DBF_STRING, "{state:'!red'}");
if (testOk1(pinp->type == JSON_LINK))
testDiag("Link was set to '%s'", pinp->value.json.string);
@@ -71,7 +72,7 @@ static void testState()
testOk(!status, "dbGetLink succeeded (status = %ld)", status);
testOk(!i16, "Got FALSE");
testdbPutFieldOk("io.OUTPUT", DBF_STRING, "{\"state\":\"red\"}");
testdbPutFieldOk("io.OUTPUT", DBF_STRING, "{state:'red'}");
if (testOk1(pout->type == JSON_LINK))
testDiag("Link was set to '%s'", pout->value.json.string);
@@ -105,7 +106,7 @@ static void testState()
testOk(!status, "dbPutLink %g succeeded (status = %ld)", f64, status);
testOk(dbStateGet(red), "state was set");
testdbPutFieldOk("io.OUTPUT", DBF_STRING, "{\"state\":\"!red\"}");
testdbPutFieldOk("io.OUTPUT", DBF_STRING, "{state:'!red'}");
if (testOk1(pout->type == JSON_LINK))
testDiag("Link was set to '%s'", pout->value.json.string);
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2018 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution.
\*************************************************************************/
+10
View File
@@ -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
@@ -156,6 +159,13 @@ asyncproctest_SRCS += asyncproctest_registerRecordDeviceDriver.cpp
TESTFILES += $(COMMON_DIR)/asyncproctest.dbd ../asyncproctest.db
TESTS += asyncproctest
TESTPROD_HOST += linkFilterTest
linkFilterTest_SRCS += linkFilterTest.c
linkFilterTest_SRCS += recTestIoc_registerRecordDeviceDriver.cpp
testHarness_SRCS += linkFilterTest.c
TESTFILES += ../linkFilterTest.db
TESTS += linkFilterTest
# dbHeader* is only a compile test
# no need to actually run
TESTPROD += dbHeaderTest
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2014 ITER Organization.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -179,7 +180,7 @@ MAIN(analogMonitorTest)
for (irec = 0; irec < NO_OF_RECORD_TYPES; irec++) {
strcpy(cval, t_Record[irec]);
strcpy(chan, cval);
strcat(chan, ".VAL{\"test\":{}}");
strcat(chan, ".VAL{test:{}}");
if ((strcmp(t_Record[irec], "sel") == 0)
|| (strcmp(t_Record[irec], "calc") == 0)
|| (strcmp(t_Record[irec], "calcout") == 0)) {
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2014 Brookhaven Science Assoc. as operator of Brookhaven
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
+1
View File
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2015 Brookhaven Science Assoc. as operator of Brookhaven
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2015 Brookhaven Science Assoc. as operator of Brookhaven
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2017 UChicago Argonne LLC, as operator of Argonne
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2018 Michael Davidsaver
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2016 Michael Davidsaver
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2019 Michael Davidsaver
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -0,0 +1,158 @@
/*************************************************************************\
* Copyright (c) 2020 Dirk Zimoch
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include <string.h>
#include "dbAccess.h"
#include "devSup.h"
#include "alarm.h"
#include "dbUnitTest.h"
#include "errlog.h"
#include "epicsThread.h"
#include "longinRecord.h"
#include "testMain.h"
void recTestIoc_registerRecordDeviceDriver(struct dbBase *);
static void startTestIoc(const char *dbfile)
{
testdbPrepare();
testdbReadDatabase("recTestIoc.dbd", NULL, NULL);
recTestIoc_registerRecordDeviceDriver(pdbbase);
testdbReadDatabase(dbfile, NULL, NULL);
eltc(0);
testIocInitOk();
eltc(1);
}
static void expectProcSuccess(const char *rec)
{
char fieldname[20];
testDiag("expecting success from %s", rec);
sprintf(fieldname, "%s.PROC", rec);
testdbPutFieldOk(fieldname, DBF_LONG, 1);
sprintf(fieldname, "%s.SEVR", rec);
testdbGetFieldEqual(fieldname, DBF_LONG, NO_ALARM);
sprintf(fieldname, "%s.STAT", rec);
testdbGetFieldEqual(fieldname, DBF_LONG, NO_ALARM);
}
static void expectProcFailure(const char *rec)
{
char fieldname[20];
testDiag("expecting failure S_db_badField %#x from %s", S_db_badField, rec);
sprintf(fieldname, "%s.PROC", rec);
testdbPutFieldFail(S_db_onlyOne, fieldname, DBF_LONG, 1);
sprintf(fieldname, "%s.SEVR", rec);
testdbGetFieldEqual(fieldname, DBF_LONG, INVALID_ALARM);
sprintf(fieldname, "%s.STAT", rec);
testdbGetFieldEqual(fieldname, DBF_LONG, LINK_ALARM);
}
static void changeRange(long start, long stop, long step)
{
char linkstring[60];
if (step)
sprintf(linkstring, "src.[%ld:%ld:%ld]", start, step, stop);
else if (stop)
sprintf(linkstring, "src.[%ld:%ld]", start, stop);
else
sprintf(linkstring, "src.[%ld]", start);
testDiag("modifying link: %s", linkstring);
testdbPutFieldOk("ai.INP", DBF_STRING, linkstring);
testdbPutFieldOk("wf.INP", DBF_STRING, linkstring);
}
static const double buf[] = {1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 2, 4, 6};
static void expectRange(long start, long end)
{
long n = end-start+1;
testdbGetFieldEqual("ai.VAL", DBF_DOUBLE, buf[start]);
testdbGetFieldEqual("wf.NORD", DBF_LONG, n);
testdbGetArrFieldEqual("wf.VAL", DBF_DOUBLE, n+2, n, buf+start);
}
static void expectEmptyArray(void)
{
testDiag("expecting empty array");
testdbGetFieldEqual("wf.NORD", DBF_LONG, 0);
}
MAIN(linkFilterTest)
{
testPlan(102);
startTestIoc("linkFilterTest.db");
testDiag("PINI");
expectRange(2,4);
testDiag("modify range");
changeRange(3,6,0);
expectProcSuccess("ai");
expectProcSuccess("wf");
expectRange(3,6);
testDiag("backward range");
changeRange(5,3,0);
expectProcFailure("ai");
expectProcSuccess("wf");
expectEmptyArray();
testDiag("step 2");
changeRange(1,6,2);
expectProcSuccess("ai");
expectProcSuccess("wf");
expectRange(10,12);
testDiag("range start beyond src.NORD");
changeRange(8,9,0);
expectProcFailure("ai");
expectProcSuccess("wf");
expectEmptyArray();
testDiag("range end beyond src.NORD");
changeRange(3,9,0);
expectProcSuccess("ai");
expectProcSuccess("wf");
expectRange(3,7); /* clipped range */
testDiag("range start beyond src.NELM");
changeRange(11,12,0);
expectProcFailure("ai");
expectProcSuccess("wf");
testDiag("range end beyond src.NELM");
changeRange(4,12,0);
expectProcSuccess("ai");
expectProcSuccess("wf");
expectRange(4,7); /* clipped range */
testDiag("single value beyond src.NORD");
changeRange(8,0,0);
expectProcFailure("ai");
expectProcSuccess("wf");
expectEmptyArray();
testDiag("single value");
changeRange(5,0,0);
expectProcSuccess("ai");
expectProcSuccess("wf");
expectRange(5,5);
testDiag("single beyond rec.NELM");
changeRange(12,0,0);
expectProcFailure("ai");
expectProcSuccess("wf");
expectEmptyArray();
testIocShutdownOk();
testdbCleanup();
return testDone();
}
@@ -0,0 +1,16 @@
record(waveform, "src") {
field(NELM, "10")
field(FTVL, "SHORT")
field(INP, [1, 2, 3, 4, 5, 6, 7, 8])
}
record(ai, "ai") {
field(INP, "src.[2]") # expect 3
field(PINI, "YES")
}
record(waveform, "wf") {
field(NELM, "5")
field(FTVL, "DOUBLE")
field(INP, "src.[2:4]") # expect 3,4,5
field(PINI, "YES")
}
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2015 Michael Davidsaver
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -18,7 +18,7 @@ record(stringout, "rec:link2") {
record(ai, "rec:j1") {
field(INP, {calc:{
expr:"A+5",
expr:'A+5',
args:5
}})
field(PINI, "YES")
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2015 Michael Davidsaver
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -74,18 +75,18 @@ static void testRetargetJLink(void)
testdbGetFieldEqual("rec:j1", DBF_DOUBLE, 10.0);
/* minimal args */
testLongStrEq("rec:j1.INP$", "{\"calc\":{\"expr\":\"A+5\",\"args\":5}}");
testLongStrEq("rec:j1.INP$", "{calc:{expr:'A+5',args:5}}");
/* with [] */
testPutLongStr("rec:j1.INP$", "{\"calc\":{\"expr\":\"A+5\",\"args\":[7]}}");
testPutLongStr("rec:j1.INP$", "{calc:{expr:'A+5',args:[7]}}");
testdbPutFieldOk("rec:j1.PROC", DBF_LONG, 1);
/* with const */
testPutLongStr("rec:j1.INP$", "{\"calc\":{\"expr\":\"A+5\",\"args\":[{\"const\":7}]}}");
testPutLongStr("rec:j1.INP$", "{calc:{expr:'A+5',args:[{const:7}]}}");
testdbPutFieldOk("rec:j1.PROC", DBF_LONG, 1);
testdbGetFieldEqual("rec:j1", DBF_DOUBLE, 12.0);
testLongStrEq("rec:j1.INP$", "{\"calc\":{\"expr\":\"A+5\",\"args\":[{\"const\":7}]}}");
testLongStrEq("rec:j1.INP$", "{calc:{expr:'A+5',args:[{const:7}]}}");
}
MAIN(linkRetargetLinkTest)
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2017 Dirk Zimoch
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
+12 -1
View File
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2017 Michael Davidsaver
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -9,6 +10,7 @@
#include "dbAccess.h"
#include "errlog.h"
#include "dbStaticLib.h"
#include "iocshRegisterCommon.h"
#include "dbUnitTest.h"
#include "testMain.h"
@@ -62,13 +64,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 */
testOk1(registerAllRecordDeviceDrivers(pdbbase)==0);
#else
testSkip(2, "only testing registerAllRecordDeviceDrivers() with dynamic linking");
#endif
recTestIoc_registerRecordDeviceDriver(pdbbase);
#ifdef LINK_DYNAMIC
testOk1(registerAllRecordDeviceDrivers(pdbbase)==0);
#endif
testdbReadDatabase("recMiscTest.db", NULL, NULL);
+3 -4
View File
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2016 Michael Davidsaver
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -70,7 +71,7 @@ void testArrayLength1(void)
}
/*
* https://bugs.launchpad.net/epics-base/+bug/1699445
* https://bugs.launchpad.net/epics-base/+bug/1699445 and 1887981
*/
static
void testHexConstantLinks(void)
@@ -80,7 +81,6 @@ void testHexConstantLinks(void)
testdbGetFieldEqual("ai1", DBR_LONG, 0x10);
testdbGetFieldEqual("li1", DBR_LONG, 0x10);
testdbGetFieldEqual("mi1", DBR_LONG, 0x10);
testTodoBegin("Needs JSON5 for hex arrays");
testdbGetFieldEqual("as1.A", DBR_LONG, 0x10);
testdbGetFieldEqual("as1.B", DBR_LONG, 0x10);
testdbGetFieldEqual("as1.C", DBR_LONG, 0x10);
@@ -89,7 +89,6 @@ void testHexConstantLinks(void)
testdbGetFieldEqual("as1.F", DBR_LONG, 0x10);
testdbGetFieldEqual("as1.G", DBR_LONG, 0x10);
testdbGetFieldEqual("as1.H", DBR_LONG, 0x10);
testTodoEnd();
testIocShutdownOk();
testdbCleanup();
@@ -132,7 +131,7 @@ void testCADisconn(void)
startRegressTestIoc("badCaLink.db");
testdbPutFieldOk("ai:disconn.PROC", DBF_LONG, 1);
testdbPutFieldFail(-1, "ai:disconn.PROC", DBF_LONG, 1);
testdbGetFieldEqual("ai:disconn.SEVR", DBF_LONG, INVALID_ALARM);
testdbGetFieldEqual("ai:disconn.STAT", DBF_LONG, LINK_ALARM);
}
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2018 Paul Scherrer Institut
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
+1
View File
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2020 Gabriel Fedel
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
+14 -5
View File
@@ -1,5 +1,6 @@
/*************************************************************************\
* Copyright (c) 2017 ITER Organization
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -264,6 +265,7 @@ void testSvalRead(const char *name,
const epicsTimeStamp *svtime)
{
epicsTimeStamp last;
double diff;
if (strcmp(name, "histogram") == 0)
strcpy(nameVAL, nameSGNL);
@@ -335,7 +337,8 @@ void testSvalRead(const char *name,
}
/* My timestamp must be later than simval's */
testOk(epicsTimeLessThan(svtime, mytime), "simval time < my time [TSE = 0]");
diff = epicsTimeDiffInSeconds(mytime, svtime);
testOk(diff >= 0.0, "simval time <= my time [TSE = 0] (%.9f sec)", diff);
testDiag("for TSE=-2 (from device) and simmYES, take time stamp from IOC or input link");
@@ -351,7 +354,8 @@ void testSvalRead(const char *name,
/* With TSE=-2 and no SIOL, timestamp is taken from IOC */
testdbPutFieldOk(nameSIOL, DBR_STRING, "");
testdbPutFieldOk(namePROC, DBR_LONG, 0);
testOk(epicsTimeLessThan(&last, mytime), "new time stamp from IOC [TSE = -2, no SIOL]");
diff = epicsTimeDiffInSeconds(mytime, &last);
testOk(diff >= 0.0, "new time stamp from IOC [TSE = -2, no SIOL] (%.9f sec)", diff);
/* Reset TSE */
testdbPutFieldOk(nameTSE, DBR_SHORT, 0);
@@ -366,6 +370,7 @@ void testSiolWrite(const char *name,
const epicsTimeStamp *mytime)
{
epicsTimeStamp now;
double diff;
testDiag("## Writing through SIOL ##");
@@ -398,7 +403,8 @@ void testSiolWrite(const char *name,
epicsTimeGetCurrent(&now);
testdbPutFieldOk(nameTSE, DBR_SHORT, -2);
testdbPutFieldOk(namePROC, DBR_LONG, 0);
testOk(epicsTimeLessThan(&now, mytime), "new time stamp from IOC [TSE = -2]");
diff = epicsTimeDiffInSeconds(mytime, &now);
testOk(diff >= 0.0, "new time stamp from IOC [TSE = -2] (%.9f sec)", diff);
/* Reset TSE */
testdbPutFieldOk(nameTSE, DBR_SHORT, 0);
@@ -415,6 +421,7 @@ void testSimmDelay(const char *name,
{
epicsTimeStamp now;
const double delay = 0.01; /* 10 ms */
double diff;
testDiag("## Asynchronous processing with simm:DELAY ##");
@@ -427,7 +434,8 @@ void testSimmDelay(const char *name,
epicsTimeGetCurrent(&now);
testdbPutFieldOk(namePROC, DBR_LONG, 0);
testdbGetFieldEqual(namePACT, DBR_USHORT, 0);
testOk(epicsTimeLessThan(&now, mytime), "time stamp is recent");
diff = epicsTimeDiffInSeconds(mytime, &now);
testOk(diff >= 0.0, "time stamp is recent (%.9f sec)", diff);
/* Process in simmYES: asynchronous */
testDiag("simm:DELAY and simmYES processes asynchronously");
@@ -439,7 +447,8 @@ void testSimmDelay(const char *name,
if(testImpreciseTiming())
testTodoBegin("imprecise");
testdbGetFieldEqual(namePACT, DBR_USHORT, 0);
testOk(epicsTimeLessThan(&now, mytime), "time stamp taken from second pass processing");
diff = epicsTimeDiffInSeconds(mytime, &now);
testOk(diff >= 0.0, "time stamp is recent (%.9f sec)", diff);
if(testImpreciseTiming())
testTodoEnd();
+1
View File
@@ -1,6 +1,7 @@
/*************************************************************************\
* Copyright (c) 2017 UChicago Argonne LLC, as operator of Argonne
* National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/