]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virhashtest: testHashGetItems: Remove test case for sorting by value
authorPeter Krempa <pkrempa@redhat.com>
Thu, 22 Oct 2020 15:41:26 +0000 (17:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 6 Nov 2020 09:31:57 +0000 (10:31 +0100)
Upcoming patch will rewrite virHashGetItems to remove the sorting
function since the prevalent mode is to order by keys.

Remove the test for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Matt Coleman <matt@datto.com>
tests/virhashtest.c

index ad50aae003433c161baafd6f4ca4e7ae50a50762..8cc3109929bb6a11ef7c58c1da75484c365149c7 100644 (file)
@@ -368,13 +368,6 @@ testHashGetItemsCompKey(const virHashKeyValuePair *a,
     return strcmp(a->key, b->key);
 }
 
-static int
-testHashGetItemsCompValue(const virHashKeyValuePair *a,
-                          const virHashKeyValuePair *b)
-{
-    return strcmp(a->value, b->value);
-}
-
 static int
 testHashGetItems(const void *data G_GNUC_UNUSED)
 {
@@ -416,18 +409,6 @@ testHashGetItems(const void *data G_GNUC_UNUSED)
     }
     VIR_FREE(array);
 
-    if (!(array = virHashGetItems(hash, testHashGetItemsCompValue)) ||
-        STRNEQ(array[0].key, "c") ||
-        STRNEQ(array[0].value, "1") ||
-        STRNEQ(array[1].key, "b") ||
-        STRNEQ(array[1].value, "2") ||
-        STRNEQ(array[2].key, "a") ||
-        STRNEQ(array[2].value, "3") ||
-        array[3].key || array[3].value) {
-        VIR_TEST_VERBOSE("\nfailed to get items with value sort");
-        goto cleanup;
-    }
-
     ret = 0;
 
  cleanup: