Modify database tests to use JSON5

(except for the tests that check parsing).
Remove escaped double-quotes in map keys where possible.
Replace escaped double-quotes with single quotes.
This commit is contained in:
Andrew Johnson
2020-08-09 00:33:07 -05:00
parent 75b89b40bf
commit 7cc246afc1
12 changed files with 106 additions and 106 deletions
@@ -180,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)) {
@@ -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")
@@ -75,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)