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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux