]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Drop virrandomtest
authorJán Tomko <jtomko@redhat.com>
Fri, 17 Jun 2016 17:37:09 +0000 (19:37 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 20 Jun 2016 16:16:50 +0000 (18:16 +0200)
This test only checks if mocking of virRandomBytes works correctly.

Drop it to avoid infinite recursion by testing the test suite.

tests/Makefile.am
tests/virrandomtest.c [deleted file]

index 592b773a24d1e596f7f962d8bc3884688e42b0c9..444e0fddfbbd9b2cb6192673ee93e87d6ab3b896 100644 (file)
@@ -170,7 +170,6 @@ test_programs = virshtest sockettest \
        virbitmaptest \
        vircgrouptest \
        vircryptotest \
-       virrandomtest \
        virpcitest \
        virendiantest \
        virfiletest \
@@ -1073,10 +1072,6 @@ vircryptotest_SOURCES = \
        vircryptotest.c testutils.h testutils.c
 vircryptotest_LDADD = $(LDADDS)
 
-virrandomtest_SOURCES = \
-       virrandomtest.c testutils.h testutils.c
-virrandomtest_LDADD = $(LDADDS)
-
 virhostdevtest_SOURCES = \
        virhostdevtest.c testutils.h testutils.c
 virhostdevtest_LDADD = $(LDADDS)
diff --git a/tests/virrandomtest.c b/tests/virrandomtest.c
deleted file mode 100644 (file)
index bafe608..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2016 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * Author: John Ferlan <jferlan@redhat.com>
- */
-
-#include <config.h>
-
-#include "internal.h"
-#include "viralloc.h"
-#include "virrandom.h"
-#include "testutils.h"
-
-#ifndef WIN32
-
-# define VIR_FROM_THIS VIR_FROM_NONE
-
-static int
-testRandomBytes(const void *unused ATTRIBUTE_UNUSED)
-{
-    int ret = -1;
-    size_t i;
-    uint8_t *data;
-    size_t datalen = 32;
-
-    if (VIR_ALLOC_N(data, datalen) < 0)
-        return -1;
-
-    if (virRandomBytes(data, datalen)) {
-        fprintf(stderr, "Failed to generate random bytes");
-        goto cleanup;
-    }
-
-    for (i = 0; i < datalen; i++) {
-        if (data[i] != i) {
-            fprintf(stderr,
-                    "virRandomBytes data[%zu]='%x' not in sequence\n",
-                    i, data[i]);
-            goto cleanup;
-        }
-    }
-
-    ret = 0;
-
- cleanup:
-    VIR_FREE(data);
-    return ret;
-}
-
-
-static int
-mymain(void)
-{
-    int ret = 0;
-
-    if (virTestRun("RandomBytes", testRandomBytes, NULL) < 0)
-        ret = -1;
-
-    return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
-}
-
-VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virrandommock.so")
-
-#else
-
-int
-main(void)
-{
-    return EXIT_AM_SKIP;
-}
-
-#endif