long CALC$ regressTest

This commit is contained in:
Michael Davidsaver
2021-08-08 09:11:04 -07:00
parent 82ec539e49
commit 88079c9107
3 changed files with 31 additions and 1 deletions

View File

@@ -128,6 +128,7 @@ regressTest_SRCS += regressTest.c
regressTest_SRCS += regressTest_registerRecordDeviceDriver.cpp
TESTFILES += $(COMMON_DIR)/regressTest.dbd ../regressArray1.db ../regressHex.db ../regressLinkMS.db
TESTFILES += ../badCaLink.db
TESTFILES += ../regressLongCalc.db
TESTS += regressTest
TARGETS += $(COMMON_DIR)/simmTest.dbd

View File

@@ -0,0 +1,5 @@
record(calc, "test_calc")
{
field(SCAN, "1 second")
field(CALC, "RNDM*100")
}

View File

@@ -141,13 +141,37 @@ void testCADisconn(void)
testdbCleanup();
}
/* https://github.com/epics-base/epics-base/issues/194 */
static
void testLongCalc(void)
{
const char small[] = "0.0000000000000000000000000000000000000001";
startRegressTestIoc("regressLongCalc.db");
testdbGetFieldEqual("test_calc.CALC", DBF_STRING, "RNDM*100");
testdbPutArrFieldOk("test_calc.CALC$", DBF_CHAR, 4, "300\0");
testdbGetFieldEqual("test_calc.CALC", DBF_STRING, "300");
testdbPutFieldOk("test_calc.PROC", DBF_LONG, 1);
testdbGetFieldEqual("test_calc", DBF_DOUBLE, 300.0);
testdbPutArrFieldOk("test_calc.CALC$", DBF_CHAR, sizeof(small), small);
testdbGetFieldEqual("test_calc.CALC", DBF_STRING, "0.0000000000000000000000000000000000000");
testdbPutFieldOk("test_calc.PROC", DBF_LONG, 1);
testdbGetFieldEqual("test_calc", DBF_DOUBLE, 1e-40);
testIocShutdownOk();
testdbCleanup();
}
MAIN(regressTest)
{
testPlan(34);
testPlan(43);
testArrayLength1();
testHexConstantLinks();
testLinkMS();
testCADisconn();
testLongCalc();
return testDone();
}