long CALC$ regressTest
This commit is contained in:
@@ -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
|
||||
|
||||
5
modules/database/test/std/rec/regressLongCalc.db
Normal file
5
modules/database/test/std/rec/regressLongCalc.db
Normal file
@@ -0,0 +1,5 @@
|
||||
record(calc, "test_calc")
|
||||
{
|
||||
field(SCAN, "1 second")
|
||||
field(CALC, "RNDM*100")
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user