]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: fix use of fixedcontent variable
authorLaine Stump <laine@laine.org>
Mon, 19 Sep 2016 17:44:21 +0000 (13:44 -0400)
committerLaine Stump <laine@laine.org>
Mon, 19 Sep 2016 21:22:26 +0000 (17:22 -0400)
commit4e2d642afb454738b2e06caffeb86d20b6f33a15
tree60dca42ad03fe27ef357de596d110c9132caa143
parent381b9d0b0acc32c57e5f3e13b5ff1e19667cefbd
tests: fix use of fixedcontent variable

Commit 8563560026d192c2cf047b550ffd468692245ed6 switched from
hardcoded use of strcontent to hardcoded use of fixedcontent
(fixedcontent is *sometimes* a copy of strcontent with a \n
appended). This was a problem because sometimes fixedcontent is *not*
a copy of strcontent, but is instead NULL, leading to the regenerated
test case output being a 0 length file.

This patch creates a new const char *cmpcontent initialized to
strcontent, but changed to fixedcontent if/when fixedcontent is
created, then always uses cmpcontent instead of (str|fixed)content.
tests/testutils.c