]> git.ipfire.org Git - pakfire.git/commitdiff
test: arch: Fix build
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 May 2021 16:35:55 +0000 (16:35 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 May 2021 16:36:35 +0000 (16:36 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/libpakfire/arch.c
tests/testsuite.h

index 6b2737578131da725ac06e484fe870f183f2bcf3..aa3097bda63d8f3e549fec6e1258c596f2266cbd 100644 (file)
@@ -83,13 +83,16 @@ static int test_compatible(const struct test* t) {
 }
 
 static int test_machine(const struct test* t) {
-       char* machine;
+       char machine[128];
+       int r;
 
-       machine = pakfire_arch_machine("x86_64", "ipfire");
+       r = pakfire_arch_machine(machine, "x86_64", "ipfire");
        ASSERT_STRING_EQUALS(machine, "x86_64-ipfire-linux-gnu");
+       ASSERT(r == 0);
 
-       machine = pakfire_arch_machine("x86_64", "IPFIRE");
+       r = pakfire_arch_machine(machine, "x86_64", "IPFIRE");
        ASSERT_STRING_EQUALS(machine, "x86_64-ipfire-linux-gnu");
+       ASSERT(r == 0);
 
        return EXIT_SUCCESS;
 }
index 412b7c910e7d97cdc6d37db87a4a9c42ec62bbcf..b56e0e6f4b5224c65ed266408cf1832bbac41130 100644 (file)
@@ -108,10 +108,6 @@ int testsuite_run();
 
 #define ASSERT_STRING_EQUALS(value, string) \
        do { \
-               if (!value) { \
-                       LOG_ERROR("Failed assertion: Expected string " #value " (%s) is NULL\n", string); \
-                       return EXIT_FAILURE; \
-               } \
                if (strcmp(string, value) != 0) { \
                        LOG_ERROR("Failed assertion: " #value " (%s) != " #string " %s:%d %s\n", \
                                value, __FILE__, __LINE__, __PRETTY_FUNCTION__); \