summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2014-12-30 11:27:56 -0600
committerNicolas Williams <nico@cryptonector.com>2014-12-30 11:28:50 -0600
commitc959d1fca16d34d9c4c325a7bcfa351b9e90b50b (patch)
treea9ad117cdae2364cd8b71e783ddedbd0594f8d0b
parent63511a874fd8a1777c8685b3322ee40e8f5262e6 (diff)
Fix lineno counting in jq_test.c
-rw-r--r--jq_test.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/jq_test.c b/jq_test.c
index 42014bea..bfdbec95 100644
--- a/jq_test.c
+++ b/jq_test.c
@@ -80,6 +80,7 @@ static void run_jq_tests(FILE *testdata) {
jq_set_error_cb(jq, NULL, NULL);
must_fail = 0;
if (!fgets(buf, sizeof(buf), testdata)) { invalid++; break; }
+ lineno++;
if (buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = 0;
if (compiled) {
printf("*** Test program compiled that should not have at line %u: %s\n", lineno, prog);
@@ -99,6 +100,7 @@ static void run_jq_tests(FILE *testdata) {
invalid++;
// skip past test data
while (fgets(buf, sizeof(buf), testdata)) {
+ lineno++;
if (buf[0] == '\n' || (buf[0] == '\r' && buf[1] == '\n'))
break;
}
@@ -108,6 +110,7 @@ static void run_jq_tests(FILE *testdata) {
jq_dump_disassembly(jq, 2);
printf("\n");
if (!fgets(buf, sizeof(buf), testdata)) { invalid++; break; }
+ lineno++;
jv input = jv_parse(buf);
if (!jv_is_valid(input)){ invalid++; continue; }
jq_start(jq, input, JQ_DEBUG_TRACE);