[PATCH] qemumonitortestutils: Fix line counting in qemuMonitorTestProcessFileEntries()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/qemumonitortestutils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index 46791931b0..4e99c4b54e 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -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';
 
-- 
2.38.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux