[PATCH 11/31] tests: virpcivpd: Remove 'testVirPCIVPDParseVPDStringResource' case

Peter Krempa posted 31 patches 7 months, 1 week ago
[PATCH 11/31] tests: virpcivpd: Remove 'testVirPCIVPDParseVPDStringResource' case
Posted by Peter Krempa 7 months, 1 week ago
The test case excercises 'virPCIVPDParseVPDLargeResourceString' which is
also tested by other cases which parse the whole VPD block. Remove the
specific test case as it's not adding any additional value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 tests/virpcivpdtest.c | 38 --------------------------------------
 1 file changed, 38 deletions(-)

diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c
index aadd1b222b..fddb42f52c 100644
--- a/tests/virpcivpdtest.c
+++ b/tests/virpcivpdtest.c
@@ -429,42 +429,6 @@ testPCIVPDGetFieldValueFormat(const void *data G_GNUC_UNUSED)
     'Y', 'E', 0x00, \
     'R', 'W', 0x02, 0x00, 0x00

-static int
-testVirPCIVPDParseVPDStringResource(const void *opaque G_GNUC_UNUSED)
-{
-    VIR_AUTOCLOSE fd = -1;
-    uint8_t csum = 0;
-    size_t dataLen = 0;
-    bool result = false;
-
-    g_autoptr(virPCIVPDResource) res = g_new0(virPCIVPDResource, 1);
-    const char *expectedValue = "testname";
-
-    const uint8_t stringResExample[] = {
-        VPD_STRING_RESOURCE_EXAMPLE_DATA
-    };
-
-    dataLen = G_N_ELEMENTS(stringResExample);
-    if ((fd = virCreateAnonymousFile(stringResExample, dataLen)) < 0)
-        return -1;
-
-    result = virPCIVPDParseVPDLargeResourceString(fd, 0, dataLen, &csum, res);
-
-    if (!result) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       "Could not parse the example resource.");
-        return -1;
-    }
-
-    if (STRNEQ(expectedValue, res->name)) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "Unexpected string resource value: %s, expected: %s",
-                       res->name, expectedValue);
-        return -1;
-    }
-    return 0;
-}
-
 static int
 testVirPCIVPDValidateExampleReadOnlyFields(virPCIVPDResource *res)
 {
@@ -964,8 +928,6 @@ mymain(void)
     if (virTestRun("Determining a field value format by a key ",
                    testPCIVPDGetFieldValueFormat, NULL) < 0)
         ret = -1;
-    if (virTestRun("Parsing VPD string resources ", testVirPCIVPDParseVPDStringResource, NULL) < 0)
-        ret = -1;
     if (virTestRun("Parsing a VPD resource with a zero-length RW ",
                    testVirPCIVPDParseZeroLengthRW, NULL) < 0)
         ret = -1;
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org