longout rec: fix behaviour when record is processed for the first time and OOPT is On Change

This commit is contained in:
Joao Paulo Martins
2021-03-10 18:50:42 +01:00
parent 1d85bc7424
commit 6c573b496a
4 changed files with 37 additions and 12 deletions

View File

@@ -222,12 +222,28 @@ static void test_changing_out_field(void){
/* Test if the counter was processed once */
testdbGetFieldEqual("counter_a", DBF_DOUBLE, 1.0);
//number of tests 24
/* reset rec processing counters */
testdbPutFieldOk("counter_a.VAL", DBF_DOUBLE, 0.0);
/* test if record with OOPT == On Change will
write to output at its first process */
testdbPutFieldOk("longout_rec2.VAL", DBF_LONG, 16);
/* Test if the counter was processed once */
testdbGetFieldEqual("counter_a", DBF_DOUBLE, 1.0);
/* write the same value */
testdbPutFieldOk("longout_rec2.VAL", DBF_LONG, 16);
/* Test if the counter was not processed again */
testdbGetFieldEqual("counter_a", DBF_DOUBLE, 1.0);
//number of tests 29
}
MAIN(longoutTest) {
testPlan(6+8+8+8+9+8+24);
testPlan(6+8+8+8+9+8+29);
testdbPrepare();
testdbReadDatabase("recTestIoc.dbd", NULL, NULL);

View File

@@ -15,3 +15,11 @@ record(longout, "longout_rec") {
field(OUT, "counter_a.B PP")
field(PINI, "YES")
}
record(longout, "longout_rec2") {
field(VAL, "16")
field(OUT, "counter_a.B PP")
field(PINI, "NO")
field(OOPT, "On Change")
}