From fa2951def756e396c92cf18f5aea70cdad311da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 26 Oct 2018 13:17:44 +0200 Subject: [PATCH] test-serialize: allocate long_string dynamically --- src/test/test-serialize.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/test-serialize.c b/src/test/test-serialize.c index 59594554119..e38b48fdbc3 100644 --- a/src/test/test-serialize.c +++ b/src/test/test-serialize.c @@ -10,11 +10,7 @@ #include "strv.h" #include "tests.h" -#define sixteen(x) x x x x x x x x x x x x x x x x -#define million(x) sixteen(sixteen(sixteen(sixteen(sixteen(x))))) - -#define long_string million("x") -assert_cc(STRLEN(long_string) == LONG_LINE_MAX); +char long_string[LONG_LINE_MAX+1]; static void test_serialize_item(void) { _cleanup_(unlink_tempfilep) char fn[] = "/tmp/test-serialize.XXXXXX"; @@ -140,6 +136,9 @@ static void test_serialize_strv(void) { int main(int argc, char *argv[]) { test_setup_logging(LOG_INFO); + memset(long_string, 'x', sizeof(long_string)-1); + char_array_0(long_string); + test_serialize_item(); test_serialize_item_escaped(); test_serialize_usec();