The test case should return -1, not 0 in case a valid resource could
not be parsed successfully but the ret value is initialized to 0.
Signed-off-by: Dmitrii Shcherbakov <dmitrii.shcherbakov(a)canonical.com>
---
tests/virpcivpdtest.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c
index b56f335fab..a4e9b2d0e6 100644
--- a/tests/virpcivpdtest.c
+++ b/tests/virpcivpdtest.c
@@ -535,7 +535,6 @@ testVirPCIVPDParseFullVPD(const void *opaque G_GNUC_UNUSED)
{
int fd = -1;
size_t dataLen = 0;
- int ret = 0;
g_autoptr(virPCIVPDResource) res = NULL;
/* Note: Custom fields are supposed to be freed by the resource cleanup code. */
@@ -556,7 +555,7 @@ testVirPCIVPDParseFullVPD(const void *opaque G_GNUC_UNUSED)
if (!res) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
"The resource pointer is NULL after parsing which is
unexpected");
- return ret;
+ return -1;
}
if (!res->ro) {
@@ -594,7 +593,7 @@ testVirPCIVPDParseFullVPD(const void *opaque G_GNUC_UNUSED)
return -1;
custom = NULL;
- return ret;
+ return 0;
}
static int
--
2.32.0