mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
tests: Introduce virTestCompareToULL()
This will be used later on in the test suite.
This commit is contained in:
@@ -721,6 +721,33 @@ virTestCompareToFile(const char *strcontent,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param content: Input content
|
||||||
|
* @param src: Source to compare @content against
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
virTestCompareToULL(unsigned long long content,
|
||||||
|
unsigned long long src)
|
||||||
|
{
|
||||||
|
char *strcontent = NULL;
|
||||||
|
char *strsrc = NULL;
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
|
if (virAsprintf(&strcontent, "%llu", content) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
if (virAsprintf(&strsrc, "%llu", src) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
ret = virTestCompareToString(strcontent, strsrc);
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
VIR_FREE(strcontent);
|
||||||
|
VIR_FREE(strsrc);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @param strcontent: String input content
|
* @param strcontent: String input content
|
||||||
* @param strsrc: String source to compare strcontent against
|
* @param strsrc: String source to compare strcontent against
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ int virTestCompareToFile(const char *strcontent,
|
|||||||
const char *filename);
|
const char *filename);
|
||||||
int virTestCompareToString(const char *strcontent,
|
int virTestCompareToString(const char *strcontent,
|
||||||
const char *strsrc);
|
const char *strsrc);
|
||||||
|
int virTestCompareToULL(unsigned long long content,
|
||||||
|
unsigned long long src);
|
||||||
|
|
||||||
unsigned int virTestGetDebug(void);
|
unsigned int virTestGetDebug(void);
|
||||||
unsigned int virTestGetVerbose(void);
|
unsigned int virTestGetVerbose(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user