]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: virpcivpd: Remove 'testVirPCIVPDParseVPDStringResource' case
authorPeter Krempa <pkrempa@redhat.com>
Mon, 29 Jan 2024 16:55:06 +0000 (17:55 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 31 Jan 2024 16:24:07 +0000 (17:24 +0100)
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/virpcivpdtest.c

index aadd1b222b72f7f3acf032c76472c3bba84395aa..fddb42f52c2e7bf64e5d4f6d5afb7e222831c5a6 100644 (file)
@@ -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;