diff options
author | Aleš Matěj <amatej@redhat.com> | 2021-02-23 18:17:49 +0300 |
---|---|---|
committer | Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com> | 2021-03-30 16:11:27 +0300 |
commit | f17303265c00eacf554f77c87f6b99b7fd47de9f (patch) | |
tree | ff16ac5931ae304140c242327f31db76e5580716 | |
parent | a7bef7e5a4884b07d0a9cac30a772949f51f780e (diff) |
Remove empty arrays in tests, pass NULL instead (fixes a compiler warning)
The empty arrays kind of don't make sense because if it has no elements
there is no memory to point to.
-rw-r--r-- | tests/test_load_metadata.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/test_load_metadata.c b/tests/test_load_metadata.c index 45a8b2b..cd5af6c 100644 --- a/tests/test_load_metadata.c +++ b/tests/test_load_metadata.c @@ -29,9 +29,6 @@ #include "createrepo/metadata_internal.h" #define REPO_SIZE_00 0 -static const char *REPO_HASH_KEYS_00[] = {}; -static const char *REPO_NAME_KEYS_00[] = {}; -static const char *REPO_FILENAME_KEYS_00[] = {}; #define REPO_SIZE_01 1 static const char *REPO_HASH_KEYS_01[] = {"152824bff2aa6d54f429d43e87a3ff3a0286505c6d93ec87692b5e3a9e3b97bf"}; @@ -47,9 +44,6 @@ static const char *REPO_FILENAME_KEYS_02[] = {"super_kernel-6.0.1-2.x86_64.rpm", "fake_bash-1.1.1-1.x86_64.rpm"}; #define REPO_SIZE_03 0 -static const char *REPO_HASH_KEYS_03[] = {}; -static const char *REPO_NAME_KEYS_03[] = {}; -static const char *REPO_FILENAME_KEYS_03[] = {}; @@ -97,9 +91,9 @@ void test_helper_check_keys(const char *repopath, cr_HashTableKey key, guint rep static void test_cr_metadata_locate_and_load_xml(void) { - test_helper_check_keys(TEST_REPO_00, CR_HT_KEY_HASH, REPO_SIZE_00, REPO_HASH_KEYS_00); - test_helper_check_keys(TEST_REPO_00, CR_HT_KEY_NAME, REPO_SIZE_00, REPO_NAME_KEYS_00); - test_helper_check_keys(TEST_REPO_00, CR_HT_KEY_FILENAME, REPO_SIZE_00, REPO_FILENAME_KEYS_00); + test_helper_check_keys(TEST_REPO_00, CR_HT_KEY_HASH, REPO_SIZE_00, NULL); + test_helper_check_keys(TEST_REPO_00, CR_HT_KEY_NAME, REPO_SIZE_00, NULL); + test_helper_check_keys(TEST_REPO_00, CR_HT_KEY_FILENAME, REPO_SIZE_00, NULL); test_helper_check_keys(TEST_REPO_01, CR_HT_KEY_HASH, REPO_SIZE_01, REPO_HASH_KEYS_01); test_helper_check_keys(TEST_REPO_01, CR_HT_KEY_NAME, REPO_SIZE_01, REPO_NAME_KEYS_01); @@ -110,9 +104,9 @@ static void test_cr_metadata_locate_and_load_xml(void) test_helper_check_keys(TEST_REPO_02, CR_HT_KEY_FILENAME, REPO_SIZE_02, REPO_FILENAME_KEYS_02); #ifdef WITH_LIBMODULEMD - test_helper_check_keys(TEST_REPO_03, CR_HT_KEY_HASH, REPO_SIZE_03, REPO_HASH_KEYS_03); - test_helper_check_keys(TEST_REPO_03, CR_HT_KEY_NAME, REPO_SIZE_03, REPO_NAME_KEYS_03); - test_helper_check_keys(TEST_REPO_03, CR_HT_KEY_FILENAME, REPO_SIZE_03, REPO_FILENAME_KEYS_03); + test_helper_check_keys(TEST_REPO_03, CR_HT_KEY_HASH, REPO_SIZE_03, NULL); + test_helper_check_keys(TEST_REPO_03, CR_HT_KEY_NAME, REPO_SIZE_03, NULL); + test_helper_check_keys(TEST_REPO_03, CR_HT_KEY_FILENAME, REPO_SIZE_03, NULL); #else /* If we don't have libmodulemd support, this should fail to locate and * return CRE_MODULEMD |