]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemumonitortestutils: Fix line counting in qemuMonitorTestProcessFileEntries()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 21 Dec 2022 10:08:02 +0000 (11:08 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 23 Dec 2022 13:48:31 +0000 (14:48 +0100)
It just so happens that our JSON snippets in
qemucapabilitiesdata/*.replies files are separated by an empty
line. These empty lines are then overwritten to make a single
line JSON. Nevertheless, the line counter @line is not
incremented which then leads to a misleading numbers in errors.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemumonitortestutils.c

index 46791931b0c9bef56a3c0b49dfcb8866dc8b9271..4e99c4b54e583e0007ca3925ef5dd11142d7fef1 100644 (file)
@@ -1302,6 +1302,9 @@ qemuMonitorTestProcessFileEntries(char *inputstr,
             continue;
         }
 
+        /* We've seen a new line, increment the counter */
+        line++;
+
         /* Cut off a single reply. */
         *(tmp + 1) = '\0';