From: Michael Tremer Date: Sat, 1 May 2021 16:35:55 +0000 (+0000) Subject: test: arch: Fix build X-Git-Tag: 0.9.28~1285^2~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5193bce9419b598106ba62782c5ea9a548c0fad;p=pakfire.git test: arch: Fix build Signed-off-by: Michael Tremer --- diff --git a/tests/libpakfire/arch.c b/tests/libpakfire/arch.c index 6b2737578..aa3097bda 100644 --- a/tests/libpakfire/arch.c +++ b/tests/libpakfire/arch.c @@ -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; } diff --git a/tests/testsuite.h b/tests/testsuite.h index 412b7c910..b56e0e6f4 100644 --- a/tests/testsuite.h +++ b/tests/testsuite.h @@ -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__); \