[libvirt PATCH 7/8] tests: delete VIR_ALLOC tests cases

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

 



There are no more users of VIR_ALLOC or VIR_ALLOC_N.
Delete their test cases.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 tests/viralloctest.c | 71 --------------------------------------------
 1 file changed, 71 deletions(-)

diff --git a/tests/viralloctest.c b/tests/viralloctest.c
index 785728d6f9..bc7bb114c1 100644
--- a/tests/viralloctest.c
+++ b/tests/viralloctest.c
@@ -43,73 +43,6 @@ testCheckNonNull(void *t)
     return 0;
 }
 
-static int
-testAllocScalar(const void *opaque G_GNUC_UNUSED)
-{
-    testDummyStruct *t;
-    int ret = -1;
-
-    if (VIR_ALLOC(t) < 0)
-        return -1;
-
-    if (testCheckNonNull(t) < 0)
-        goto cleanup;
-
-    if (t->a != 0 ||
-        t->b != 0) {
-        fprintf(stderr, "Allocated ram was not zerod\n");
-        goto cleanup;
-    }
-
-    VIR_FREE(t);
-
-    if (t != NULL) {
-        fprintf(stderr, "Pointer is still set after free\n");
-        goto cleanup;
-    }
-
-    ret = 0;
- cleanup:
-    VIR_FREE(t);
-    return ret;
-}
-
-
-static int
-testAllocArray(const void *opaque G_GNUC_UNUSED)
-{
-    testDummyStruct *t;
-    size_t nt = 10, i;
-    int ret = -1;
-
-    if (VIR_ALLOC_N(t, nt) < 0)
-        return -1;
-
-    if (testCheckNonNull(t) < 0)
-        goto cleanup;
-
-    for (i = 0; i < nt; i++) {
-        if (t[i].a != 0 ||
-            t[i].b != 0) {
-            fprintf(stderr, "Allocated ram block %zu was not zerod\n", i);
-            goto cleanup;
-        }
-    }
-
-    VIR_FREE(t);
-
-    if (t != NULL) {
-        fprintf(stderr, "Pointer is still set after free\n");
-        goto cleanup;
-    }
-
-    ret = 0;
- cleanup:
-    VIR_FREE(t);
-    return ret;
-}
-
-
 static int
 testReallocArray(const void *opaque G_GNUC_UNUSED)
 {
@@ -416,10 +349,6 @@ mymain(void)
 {
     int ret = 0;
 
-    if (virTestRun("alloc scalar", testAllocScalar, NULL) < 0)
-        ret = -1;
-    if (virTestRun("alloc array", testAllocArray, NULL) < 0)
-        ret = -1;
     if (virTestRun("realloc array", testReallocArray, NULL) < 0)
         ret = -1;
     if (virTestRun("expand array", testExpandArray, NULL) < 0)
-- 
2.26.2




[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