From: Peter Krempa Date: Tue, 26 Sep 2017 15:11:16 +0000 (+0200) Subject: tests: qemuxml2xml: Simplify adding to the status XML expect string generator X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=41b28943da6162e20b3d89be9d2def93a370aefb;p=libvirt.git tests: qemuxml2xml: Simplify adding to the status XML expect string generator Unindent the static XML block and move around the autoindent calls so that further additions don't have to add more of them. Also rename the string holding the static XML section. --- diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 73489eed93..7d7a5f1e4b 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -81,23 +81,23 @@ static const char testStatusXMLPrefixHeader[] = " \n" " \n"; -static const char testStatusXMLPrefixFooter[] = -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n"; +static const char testStatusXMLPrefixBodyStatic[] = +"\n" +" \n" +" \n" +" \n" +" \n" +"\n" +"\n" +" \n" +" \n" +" \n" +" \n" +" \n" +"\n" +"\n" +"\n" +"\n"; static const char testStatusXMLSuffix[] = "\n"; @@ -134,8 +134,9 @@ testGetStatusXMLPrefix(const struct testInfo *data) testGetStatuXMLPrefixVcpus(&buf, data); + virBufferAddStr(&buf, testStatusXMLPrefixBodyStatic); + virBufferAdjustIndent(&buf, -2); - virBufferAdd(&buf, testStatusXMLPrefixFooter, -1); return virBufferContentAndReset(&buf); }