diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-10-26 13:17:44 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-10-26 13:17:44 +0200 |
commit | fa2951def756e396c92cf18f5aea70cdad311da5 (patch) | |
tree | 25ec6a021a4fe1e6988662ad6a5342540e7d1ec8 | |
parent | test-serialize: a smoke test for the serialization functions (diff) | |
download | systemd-fa2951def756e396c92cf18f5aea70cdad311da5.tar.xz systemd-fa2951def756e396c92cf18f5aea70cdad311da5.zip |
test-serialize: allocate long_string dynamically
Diffstat (limited to '')
-rw-r--r-- | src/test/test-serialize.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/test/test-serialize.c b/src/test/test-serialize.c index 5959455411..e38b48fdbc 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(); |