Treat an NULL string equivalent to an empty string in
virTestCompareToFile so that callers don't need to add additional logic
in case when a test produces no output.
/*
* @param strcontent: String input content
* @param filename: File to compare strcontent against
+ *
+ * If @strcontent is NULL, it's treated as an empty string.
*/
int
virTestCompareToFile(const char *strcontent,
char *fixedcontent = NULL;
const char *cmpcontent = strcontent;
+ if (!cmpcontent)
+ cmpcontent = "";
+
if (virTestLoadFile(filename, &filecontent) < 0 && !virTestGetRegenerate())
goto failure;