提交 1025264e 编写于 作者: P Peter Krempa

tests: qemumonitor: Optimize control flow when concatenating replies

The test file can be broken up by newlines and is automatically
concatenated back. Fix the control flow so that the concatenation code
'continues' the loop rather than branching out.

Also add an anotation to the concatenation code.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 dcea889b
...@@ -1423,10 +1423,13 @@ qemuMonitorTestNewFromFileFull(const char *fileName, ...@@ -1423,10 +1423,13 @@ qemuMonitorTestNewFromFileFull(const char *fileName,
if (!tmp[1]) if (!tmp[1])
break; break;
/* concatenate block which was broken up for readability */
if (*(tmp + 1) != '\n') { if (*(tmp + 1) != '\n') {
*tmp = ' '; *tmp = ' ';
tmp++; tmp++;
} else { continue;
}
/* Cut off a single reply. */ /* Cut off a single reply. */
*(tmp + 1) = '\0'; *(tmp + 1) = '\0';
...@@ -1448,7 +1451,6 @@ qemuMonitorTestNewFromFileFull(const char *fileName, ...@@ -1448,7 +1451,6 @@ qemuMonitorTestNewFromFileFull(const char *fileName,
response = tmp; response = tmp;
} }
} }
}
if (command) { if (command) {
if (!response) { if (!response) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册