From 7980d78908f8a1b2af1bd1cea66ac7d8040404df Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 23 May 2017 21:20:45 -0400 Subject: [PATCH] Add tests for 64-bit constant link initializers --- src/std/rec/test/linkInitTest.c | 20 +++++++++++++++++++- src/std/rec/test/linkInitTest.db | 16 ++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/std/rec/test/linkInitTest.c b/src/std/rec/test/linkInitTest.c index cf279b5aa..7225beb1c 100644 --- a/src/std/rec/test/linkInitTest.c +++ b/src/std/rec/test/linkInitTest.c @@ -210,16 +210,34 @@ static void testEventRecord() testdbCleanup(); } +void testInt64Inputs(void) +{ + testDiag("testInt64Inputs"); + + startTestIoc("linkInitTest.db"); + + testdbGetFieldEqual("i1.VAL", DBR_INT64, 1234567890123456789LL); + testdbGetFieldEqual("i2.VAL", DBR_INT64, 1234567890123456789LL); + testdbGetFieldEqual("i3.VAL", DBR_INT64, 1234567890123456789LL); + + testdbGetFieldEqual("i4.NORD", DBR_LONG, 1); + testdbGetFieldEqual("i4.VAL", DBR_INT64, 1234567890123456789LL); + + testIocShutdownOk(); + testdbCleanup(); +} + MAIN(linkInitTest) { - testPlan(72); + testPlan(77); testLongStringInit(); testCalcInit(); testPrintfStrings(); testArrayInputs(); testEventRecord(); + testInt64Inputs(); return testDone(); } diff --git a/src/std/rec/test/linkInitTest.db b/src/std/rec/test/linkInitTest.db index 701490073..99bc0ccfb 100644 --- a/src/std/rec/test/linkInitTest.db +++ b/src/std/rec/test/linkInitTest.db @@ -88,3 +88,19 @@ record(event, "ev1") { record(event, "ev2") { field(INP, "count1.EVNT") } + +record(int64in, "i1") { + field(INP, [1234567890123456789,0]) +} +record(int64in, "i2") { + field(INP, {const:1234567890123456789}) +} +record(int64in, "i3") { + field(INP, 1234567890123456789) +} +record(waveform, "i4") { + field(NELM, 1) + field(FTVL, "INT64") + field(INP, [1234567890123456789,0]) +} +