File: | build-scan/../src/test/test-extract-word.c |
Warning: | line 70, column 13 Although the value stored to 'original' is used in the enclosing expression, the value is never actually read from 'original' |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
2 | |
3 | #include <errno(*__errno_location ()).h> |
4 | #include <stdlib.h> |
5 | #include <string.h> |
6 | |
7 | #include "extract-word.h" |
8 | #include "log.h" |
9 | #include "string-util.h" |
10 | |
11 | static void test_extract_first_word(void) { |
12 | const char *p, *original; |
13 | char *t; |
14 | |
15 | p = original = "foobar waldo"; |
16 | assert_se(extract_first_word(&p, &t, NULL, 0) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) > 0"), "../src/test/test-extract-word.c" , 16, __PRETTY_FUNCTION__); } while (0); |
17 | assert_se(streq(t, "foobar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foobar")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foobar\")" ), "../src/test/test-extract-word.c", 17, __PRETTY_FUNCTION__ ); } while (0); |
18 | free(t); |
19 | assert_se(p == original + 7)do { if ((__builtin_expect(!!(!(p == original + 7)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 7"), "../src/test/test-extract-word.c" , 19, __PRETTY_FUNCTION__); } while (0); |
20 | |
21 | assert_se(extract_first_word(&p, &t, NULL, 0) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) > 0"), "../src/test/test-extract-word.c" , 21, __PRETTY_FUNCTION__); } while (0); |
22 | assert_se(streq(t, "waldo"))do { if ((__builtin_expect(!!(!((strcmp((t),("waldo")) == 0)) ),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"waldo\")" ), "../src/test/test-extract-word.c", 22, __PRETTY_FUNCTION__ ); } while (0); |
23 | free(t); |
24 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 24, __PRETTY_FUNCTION__); } while (0); |
25 | |
26 | assert_se(extract_first_word(&p, &t, NULL, 0) == 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) == 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) == 0"), "../src/test/test-extract-word.c" , 26, __PRETTY_FUNCTION__); } while (0); |
27 | assert_se(!t)do { if ((__builtin_expect(!!(!(!t)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("!t"), "../src/test/test-extract-word.c" , 27, __PRETTY_FUNCTION__); } while (0); |
28 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 28, __PRETTY_FUNCTION__); } while (0); |
29 | |
30 | p = original = "\"foobar\" \'waldo\'"; |
31 | assert_se(extract_first_word(&p, &t, NULL, 0) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) > 0"), "../src/test/test-extract-word.c" , 31, __PRETTY_FUNCTION__); } while (0); |
32 | assert_se(streq(t, "\"foobar\""))do { if ((__builtin_expect(!!(!((strcmp((t),("\"foobar\"")) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\\\"foobar\\\"\")" ), "../src/test/test-extract-word.c", 32, __PRETTY_FUNCTION__ ); } while (0); |
33 | free(t); |
34 | assert_se(p == original + 9)do { if ((__builtin_expect(!!(!(p == original + 9)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 9"), "../src/test/test-extract-word.c" , 34, __PRETTY_FUNCTION__); } while (0); |
35 | |
36 | assert_se(extract_first_word(&p, &t, NULL, 0) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) > 0"), "../src/test/test-extract-word.c" , 36, __PRETTY_FUNCTION__); } while (0); |
37 | assert_se(streq(t, "\'waldo\'"))do { if ((__builtin_expect(!!(!((strcmp((t),("\'waldo\'")) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\\'waldo\\'\")" ), "../src/test/test-extract-word.c", 37, __PRETTY_FUNCTION__ ); } while (0); |
38 | free(t); |
39 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 39, __PRETTY_FUNCTION__); } while (0); |
40 | |
41 | assert_se(extract_first_word(&p, &t, NULL, 0) == 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) == 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) == 0"), "../src/test/test-extract-word.c" , 41, __PRETTY_FUNCTION__); } while (0); |
42 | assert_se(!t)do { if ((__builtin_expect(!!(!(!t)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("!t"), "../src/test/test-extract-word.c" , 42, __PRETTY_FUNCTION__); } while (0); |
43 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 43, __PRETTY_FUNCTION__); } while (0); |
44 | |
45 | p = original = "\"foobar\" \'waldo\'"; |
46 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) > 0" ), "../src/test/test-extract-word.c", 46, __PRETTY_FUNCTION__ ); } while (0); |
47 | assert_se(streq(t, "foobar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foobar")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foobar\")" ), "../src/test/test-extract-word.c", 47, __PRETTY_FUNCTION__ ); } while (0); |
48 | free(t); |
49 | assert_se(p == original + 9)do { if ((__builtin_expect(!!(!(p == original + 9)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 9"), "../src/test/test-extract-word.c" , 49, __PRETTY_FUNCTION__); } while (0); |
50 | |
51 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) > 0" ), "../src/test/test-extract-word.c", 51, __PRETTY_FUNCTION__ ); } while (0); |
52 | assert_se(streq(t, "waldo"))do { if ((__builtin_expect(!!(!((strcmp((t),("waldo")) == 0)) ),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"waldo\")" ), "../src/test/test-extract-word.c", 52, __PRETTY_FUNCTION__ ); } while (0); |
53 | free(t); |
54 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 54, __PRETTY_FUNCTION__); } while (0); |
55 | |
56 | assert_se(extract_first_word(&p, &t, NULL, 0) == 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) == 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) == 0"), "../src/test/test-extract-word.c" , 56, __PRETTY_FUNCTION__); } while (0); |
57 | assert_se(!t)do { if ((__builtin_expect(!!(!(!t)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("!t"), "../src/test/test-extract-word.c" , 57, __PRETTY_FUNCTION__); } while (0); |
58 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 58, __PRETTY_FUNCTION__); } while (0); |
59 | |
60 | p = original = "\""; |
61 | assert_se(extract_first_word(&p, &t, NULL, 0) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) == 1)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) == 1"), "../src/test/test-extract-word.c" , 61, __PRETTY_FUNCTION__); } while (0); |
62 | assert_se(streq(t, "\""))do { if ((__builtin_expect(!!(!((strcmp((t),("\"")) == 0))),0 ))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\\\"\")" ), "../src/test/test-extract-word.c", 62, __PRETTY_FUNCTION__ ); } while (0); |
63 | free(t); |
64 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 64, __PRETTY_FUNCTION__); } while (0); |
65 | |
66 | p = original = "\""; |
67 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES) == -22)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) == -EINVAL" ), "../src/test/test-extract-word.c", 67, __PRETTY_FUNCTION__ ); } while (0); |
68 | assert_se(p == original + 1)do { if ((__builtin_expect(!!(!(p == original + 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 1"), "../src/test/test-extract-word.c" , 68, __PRETTY_FUNCTION__); } while (0); |
69 | |
70 | p = original = "\'"; |
Although the value stored to 'original' is used in the enclosing expression, the value is never actually read from 'original' | |
71 | assert_se(extract_first_word(&p, &t, NULL, 0) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) == 1)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) == 1"), "../src/test/test-extract-word.c" , 71, __PRETTY_FUNCTION__); } while (0); |
72 | assert_se(streq(t, "\'"))do { if ((__builtin_expect(!!(!((strcmp((t),("\'")) == 0))),0 ))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\\'\")" ), "../src/test/test-extract-word.c", 72, __PRETTY_FUNCTION__ ); } while (0); |
73 | free(t); |
74 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 74, __PRETTY_FUNCTION__); } while (0); |
75 | |
76 | p = original = "\'"; |
77 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES) == -22)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) == -EINVAL" ), "../src/test/test-extract-word.c", 77, __PRETTY_FUNCTION__ ); } while (0); |
78 | assert_se(p == original + 1)do { if ((__builtin_expect(!!(!(p == original + 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 1"), "../src/test/test-extract-word.c" , 78, __PRETTY_FUNCTION__); } while (0); |
79 | |
80 | p = original = "\'fooo"; |
81 | assert_se(extract_first_word(&p, &t, NULL, 0) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) == 1)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) == 1"), "../src/test/test-extract-word.c" , 81, __PRETTY_FUNCTION__); } while (0); |
82 | assert_se(streq(t, "\'fooo"))do { if ((__builtin_expect(!!(!((strcmp((t),("\'fooo")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\\'fooo\")" ), "../src/test/test-extract-word.c", 82, __PRETTY_FUNCTION__ ); } while (0); |
83 | free(t); |
84 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 84, __PRETTY_FUNCTION__); } while (0); |
85 | |
86 | p = original = "\'fooo"; |
87 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES) == -22)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) == -EINVAL" ), "../src/test/test-extract-word.c", 87, __PRETTY_FUNCTION__ ); } while (0); |
88 | assert_se(p == original + 5)do { if ((__builtin_expect(!!(!(p == original + 5)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 5"), "../src/test/test-extract-word.c" , 88, __PRETTY_FUNCTION__); } while (0); |
89 | |
90 | p = original = "\'fooo"; |
91 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES|EXTRACT_RELAX) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX) > 0" ), "../src/test/test-extract-word.c", 91, __PRETTY_FUNCTION__ ); } while (0); |
92 | assert_se(streq(t, "fooo"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo")) == 0))) ,0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\")" ), "../src/test/test-extract-word.c", 92, __PRETTY_FUNCTION__ ); } while (0); |
93 | free(t); |
94 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 94, __PRETTY_FUNCTION__); } while (0); |
95 | |
96 | p = original = "\"fooo"; |
97 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES|EXTRACT_RELAX) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX) > 0" ), "../src/test/test-extract-word.c", 97, __PRETTY_FUNCTION__ ); } while (0); |
98 | assert_se(streq(t, "fooo"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo")) == 0))) ,0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\")" ), "../src/test/test-extract-word.c", 98, __PRETTY_FUNCTION__ ); } while (0); |
99 | free(t); |
100 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 100, __PRETTY_FUNCTION__); } while (0); |
101 | |
102 | p = original = "yay\'foo\'bar"; |
103 | assert_se(extract_first_word(&p, &t, NULL, 0) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) > 0"), "../src/test/test-extract-word.c" , 103, __PRETTY_FUNCTION__); } while (0); |
104 | assert_se(streq(t, "yay\'foo\'bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("yay\'foo\'bar") ) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"yay\\'foo\\'bar\")" ), "../src/test/test-extract-word.c", 104, __PRETTY_FUNCTION__ ); } while (0); |
105 | free(t); |
106 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 106, __PRETTY_FUNCTION__); } while (0); |
107 | |
108 | p = original = "yay\'foo\'bar"; |
109 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) > 0" ), "../src/test/test-extract-word.c", 109, __PRETTY_FUNCTION__ ); } while (0); |
110 | assert_se(streq(t, "yayfoobar"))do { if ((__builtin_expect(!!(!((strcmp((t),("yayfoobar")) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"yayfoobar\")" ), "../src/test/test-extract-word.c", 110, __PRETTY_FUNCTION__ ); } while (0); |
111 | free(t); |
112 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 112, __PRETTY_FUNCTION__); } while (0); |
113 | |
114 | p = original = " foobar "; |
115 | assert_se(extract_first_word(&p, &t, NULL, 0) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) > 0"), "../src/test/test-extract-word.c" , 115, __PRETTY_FUNCTION__); } while (0); |
116 | assert_se(streq(t, "foobar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foobar")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foobar\")" ), "../src/test/test-extract-word.c", 116, __PRETTY_FUNCTION__ ); } while (0); |
117 | free(t); |
118 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 118, __PRETTY_FUNCTION__); } while (0); |
119 | |
120 | p = original = " foo\\ba\\x6ar "; |
121 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) > 0" ), "../src/test/test-extract-word.c", 121, __PRETTY_FUNCTION__ ); } while (0); |
122 | assert_se(streq(t, "foo\ba\x6ar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo\ba\x6ar")) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo\\ba\\x6ar\")" ), "../src/test/test-extract-word.c", 122, __PRETTY_FUNCTION__ ); } while (0); |
123 | free(t); |
124 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 124, __PRETTY_FUNCTION__); } while (0); |
125 | |
126 | p = original = " foo\\ba\\x6ar "; |
127 | assert_se(extract_first_word(&p, &t, NULL, 0) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) > 0"), "../src/test/test-extract-word.c" , 127, __PRETTY_FUNCTION__); } while (0); |
128 | assert_se(streq(t, "foobax6ar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foobax6ar")) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foobax6ar\")" ), "../src/test/test-extract-word.c", 128, __PRETTY_FUNCTION__ ); } while (0); |
129 | free(t); |
130 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 130, __PRETTY_FUNCTION__); } while (0); |
131 | |
132 | p = original = " f\\u00f6o \"pi\\U0001F4A9le\" "; |
133 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) > 0" ), "../src/test/test-extract-word.c", 133, __PRETTY_FUNCTION__ ); } while (0); |
134 | assert_se(streq(t, "föo"))do { if ((__builtin_expect(!!(!((strcmp((t),("föo")) == 0))) ,0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"föo\")" ), "../src/test/test-extract-word.c", 134, __PRETTY_FUNCTION__ ); } while (0); |
135 | free(t); |
136 | assert_se(p == original + 13)do { if ((__builtin_expect(!!(!(p == original + 13)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 13"), "../src/test/test-extract-word.c" , 136, __PRETTY_FUNCTION__); } while (0); |
137 | |
138 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES|EXTRACT_CUNESCAPE) > 0)),0)) ) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE) > 0" ), "../src/test/test-extract-word.c", 138, __PRETTY_FUNCTION__ ); } while (0); |
139 | assert_se(streq(t, "pi\360\237\222\251le"))do { if ((__builtin_expect(!!(!((strcmp((t),("pi\360\237\222\251le" )) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"pi\\360\\237\\222\\251le\")" ), "../src/test/test-extract-word.c", 139, __PRETTY_FUNCTION__ ); } while (0); |
140 | free(t); |
141 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 141, __PRETTY_FUNCTION__); } while (0); |
142 | |
143 | p = original = "fooo\\"; |
144 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_RELAX) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_RELAX) > 0" ), "../src/test/test-extract-word.c", 144, __PRETTY_FUNCTION__ ); } while (0); |
145 | assert_se(streq(t, "fooo"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo")) == 0))) ,0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\")" ), "../src/test/test-extract-word.c", 145, __PRETTY_FUNCTION__ ); } while (0); |
146 | free(t); |
147 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 147, __PRETTY_FUNCTION__); } while (0); |
148 | |
149 | p = original = "fooo\\"; |
150 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE_RELAX) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE_RELAX) > 0" ), "../src/test/test-extract-word.c", 150, __PRETTY_FUNCTION__ ); } while (0); |
151 | assert_se(streq(t, "fooo\\"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo\\")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\\\\\")" ), "../src/test/test-extract-word.c", 151, __PRETTY_FUNCTION__ ); } while (0); |
152 | free(t); |
153 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 153, __PRETTY_FUNCTION__); } while (0); |
154 | |
155 | p = original = "fooo\\"; |
156 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX) > 0) ),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX) > 0" ), "../src/test/test-extract-word.c", 156, __PRETTY_FUNCTION__ ); } while (0); |
157 | assert_se(streq(t, "fooo\\"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo\\")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\\\\\")" ), "../src/test/test-extract-word.c", 157, __PRETTY_FUNCTION__ ); } while (0); |
158 | free(t); |
159 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 159, __PRETTY_FUNCTION__); } while (0); |
160 | |
161 | p = original = "fooo\\"; |
162 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0" ), "../src/test/test-extract-word.c", 162, __PRETTY_FUNCTION__ ); } while (0); |
163 | assert_se(streq(t, "fooo\\"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo\\")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\\\\\")" ), "../src/test/test-extract-word.c", 163, __PRETTY_FUNCTION__ ); } while (0); |
164 | free(t); |
165 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 165, __PRETTY_FUNCTION__); } while (0); |
166 | |
167 | p = original = "\"foo\\"; |
168 | assert_se(extract_first_word(&p, &t, NULL, 0) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) == -22)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) == -EINVAL"), "../src/test/test-extract-word.c", 168, __PRETTY_FUNCTION__) ; } while (0); |
169 | assert_se(p == original + 5)do { if ((__builtin_expect(!!(!(p == original + 5)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 5"), "../src/test/test-extract-word.c" , 169, __PRETTY_FUNCTION__); } while (0); |
170 | |
171 | p = original = "\"foo\\"; |
172 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES|EXTRACT_RELAX) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX) > 0" ), "../src/test/test-extract-word.c", 172, __PRETTY_FUNCTION__ ); } while (0); |
173 | assert_se(streq(t, "foo"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo")) == 0))), 0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo\")" ), "../src/test/test-extract-word.c", 173, __PRETTY_FUNCTION__ ); } while (0); |
174 | free(t); |
175 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 175, __PRETTY_FUNCTION__); } while (0); |
176 | |
177 | p = original = "foo::bar"; |
178 | assert_se(extract_first_word(&p, &t, ":", 0) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", 0) == 1)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, \":\", 0) == 1"), "../src/test/test-extract-word.c" , 178, __PRETTY_FUNCTION__); } while (0); |
179 | assert_se(streq(t, "foo"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo")) == 0))), 0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo\")" ), "../src/test/test-extract-word.c", 179, __PRETTY_FUNCTION__ ); } while (0); |
180 | free(t); |
181 | assert_se(p == original + 5)do { if ((__builtin_expect(!!(!(p == original + 5)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 5"), "../src/test/test-extract-word.c" , 181, __PRETTY_FUNCTION__); } while (0); |
182 | |
183 | assert_se(extract_first_word(&p, &t, ":", 0) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", 0) == 1)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, \":\", 0) == 1"), "../src/test/test-extract-word.c" , 183, __PRETTY_FUNCTION__); } while (0); |
184 | assert_se(streq(t, "bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("bar")) == 0))), 0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"bar\")" ), "../src/test/test-extract-word.c", 184, __PRETTY_FUNCTION__ ); } while (0); |
185 | free(t); |
186 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 186, __PRETTY_FUNCTION__); } while (0); |
187 | |
188 | assert_se(extract_first_word(&p, &t, ":", 0) == 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", 0) == 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, \":\", 0) == 0"), "../src/test/test-extract-word.c" , 188, __PRETTY_FUNCTION__); } while (0); |
189 | assert_se(!t)do { if ((__builtin_expect(!!(!(!t)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("!t"), "../src/test/test-extract-word.c" , 189, __PRETTY_FUNCTION__); } while (0); |
190 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 190, __PRETTY_FUNCTION__); } while (0); |
191 | |
192 | p = original = "foo\\:bar::waldo"; |
193 | assert_se(extract_first_word(&p, &t, ":", 0) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", 0) == 1)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, \":\", 0) == 1"), "../src/test/test-extract-word.c" , 193, __PRETTY_FUNCTION__); } while (0); |
194 | assert_se(streq(t, "foo:bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo:bar")) == 0 ))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo:bar\")" ), "../src/test/test-extract-word.c", 194, __PRETTY_FUNCTION__ ); } while (0); |
195 | free(t); |
196 | assert_se(p == original + 10)do { if ((__builtin_expect(!!(!(p == original + 10)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 10"), "../src/test/test-extract-word.c" , 196, __PRETTY_FUNCTION__); } while (0); |
197 | |
198 | assert_se(extract_first_word(&p, &t, ":", 0) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", 0) == 1)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, \":\", 0) == 1"), "../src/test/test-extract-word.c" , 198, __PRETTY_FUNCTION__); } while (0); |
199 | assert_se(streq(t, "waldo"))do { if ((__builtin_expect(!!(!((strcmp((t),("waldo")) == 0)) ),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"waldo\")" ), "../src/test/test-extract-word.c", 199, __PRETTY_FUNCTION__ ); } while (0); |
200 | free(t); |
201 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 201, __PRETTY_FUNCTION__); } while (0); |
202 | |
203 | assert_se(extract_first_word(&p, &t, ":", 0) == 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", 0) == 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, \":\", 0) == 0"), "../src/test/test-extract-word.c" , 203, __PRETTY_FUNCTION__); } while (0); |
204 | assert_se(!t)do { if ((__builtin_expect(!!(!(!t)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("!t"), "../src/test/test-extract-word.c" , 204, __PRETTY_FUNCTION__); } while (0); |
205 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 205, __PRETTY_FUNCTION__); } while (0); |
206 | |
207 | p = original = "\"foo\\"; |
208 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE_RELAX) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES|EXTRACT_CUNESCAPE_RELAX) == -22 )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE_RELAX) == -EINVAL" ), "../src/test/test-extract-word.c", 208, __PRETTY_FUNCTION__ ); } while (0); |
209 | assert_se(p == original + 5)do { if ((__builtin_expect(!!(!(p == original + 5)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 5"), "../src/test/test-extract-word.c" , 209, __PRETTY_FUNCTION__); } while (0); |
210 | |
211 | p = original = "\"foo\\"; |
212 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES|EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX ) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX) > 0" ), "../src/test/test-extract-word.c", 212, __PRETTY_FUNCTION__ ); } while (0); |
213 | assert_se(streq(t, "foo\\"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo\\")) == 0)) ),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo\\\\\")" ), "../src/test/test-extract-word.c", 213, __PRETTY_FUNCTION__ ); } while (0); |
214 | free(t); |
215 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 215, __PRETTY_FUNCTION__); } while (0); |
216 | |
217 | p = original = "\"foo\\"; |
218 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES|EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX |EXTRACT_RELAX) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX) > 0" ), "../src/test/test-extract-word.c", 218, __PRETTY_FUNCTION__ ); } while (0); |
219 | assert_se(streq(t, "foo\\"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo\\")) == 0)) ),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo\\\\\")" ), "../src/test/test-extract-word.c", 219, __PRETTY_FUNCTION__ ); } while (0); |
220 | free(t); |
221 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 221, __PRETTY_FUNCTION__); } while (0); |
222 | |
223 | p = original = "fooo\\ bar quux"; |
224 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_RELAX) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_RELAX) > 0" ), "../src/test/test-extract-word.c", 224, __PRETTY_FUNCTION__ ); } while (0); |
225 | assert_se(streq(t, "fooo bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo bar")) == 0 ))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo bar\")" ), "../src/test/test-extract-word.c", 225, __PRETTY_FUNCTION__ ); } while (0); |
226 | free(t); |
227 | assert_se(p == original + 10)do { if ((__builtin_expect(!!(!(p == original + 10)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 10"), "../src/test/test-extract-word.c" , 227, __PRETTY_FUNCTION__); } while (0); |
228 | |
229 | p = original = "fooo\\ bar quux"; |
230 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE_RELAX) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE_RELAX) > 0" ), "../src/test/test-extract-word.c", 230, __PRETTY_FUNCTION__ ); } while (0); |
231 | assert_se(streq(t, "fooo bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo bar")) == 0 ))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo bar\")" ), "../src/test/test-extract-word.c", 231, __PRETTY_FUNCTION__ ); } while (0); |
232 | free(t); |
233 | assert_se(p == original + 10)do { if ((__builtin_expect(!!(!(p == original + 10)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 10"), "../src/test/test-extract-word.c" , 233, __PRETTY_FUNCTION__); } while (0); |
234 | |
235 | p = original = "fooo\\ bar quux"; |
236 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX) > 0) ),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE_RELAX|EXTRACT_RELAX) > 0" ), "../src/test/test-extract-word.c", 236, __PRETTY_FUNCTION__ ); } while (0); |
237 | assert_se(streq(t, "fooo bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo bar")) == 0 ))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo bar\")" ), "../src/test/test-extract-word.c", 237, __PRETTY_FUNCTION__ ); } while (0); |
238 | free(t); |
239 | assert_se(p == original + 10)do { if ((__builtin_expect(!!(!(p == original + 10)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 10"), "../src/test/test-extract-word.c" , 239, __PRETTY_FUNCTION__); } while (0); |
240 | |
241 | p = original = "fooo\\ bar quux"; |
242 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE) == -22)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) == -EINVAL" ), "../src/test/test-extract-word.c", 242, __PRETTY_FUNCTION__ ); } while (0); |
243 | assert_se(p == original + 5)do { if ((__builtin_expect(!!(!(p == original + 5)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 5"), "../src/test/test-extract-word.c" , 243, __PRETTY_FUNCTION__); } while (0); |
244 | |
245 | p = original = "fooo\\ bar quux"; |
246 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0" ), "../src/test/test-extract-word.c", 246, __PRETTY_FUNCTION__ ); } while (0); |
247 | assert_se(streq(t, "fooo\\ bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo\\ bar")) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\\\\ bar\")" ), "../src/test/test-extract-word.c", 247, __PRETTY_FUNCTION__ ); } while (0); |
248 | free(t); |
249 | assert_se(p == original + 10)do { if ((__builtin_expect(!!(!(p == original + 10)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 10"), "../src/test/test-extract-word.c" , 249, __PRETTY_FUNCTION__); } while (0); |
250 | |
251 | p = original = "\\w+@\\K[\\d.]+"; |
252 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE) == -22)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE) == -EINVAL" ), "../src/test/test-extract-word.c", 252, __PRETTY_FUNCTION__ ); } while (0); |
253 | assert_se(p == original + 1)do { if ((__builtin_expect(!!(!(p == original + 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 1"), "../src/test/test-extract-word.c" , 253, __PRETTY_FUNCTION__); } while (0); |
254 | |
255 | p = original = "\\w+@\\K[\\d.]+"; |
256 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0" ), "../src/test/test-extract-word.c", 256, __PRETTY_FUNCTION__ ); } while (0); |
257 | assert_se(streq(t, "\\w+@\\K[\\d.]+"))do { if ((__builtin_expect(!!(!((strcmp((t),("\\w+@\\K[\\d.]+" )) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\\\\w+@\\\\K[\\\\d.]+\")" ), "../src/test/test-extract-word.c", 257, __PRETTY_FUNCTION__ ); } while (0); |
258 | free(t); |
259 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 259, __PRETTY_FUNCTION__); } while (0); |
260 | |
261 | p = original = "\\w+\\b"; |
262 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_CUNESCAPE|EXTRACT_CUNESCAPE_RELAX) > 0" ), "../src/test/test-extract-word.c", 262, __PRETTY_FUNCTION__ ); } while (0); |
263 | assert_se(streq(t, "\\w+\b"))do { if ((__builtin_expect(!!(!((strcmp((t),("\\w+\b")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\\\\w+\\b\")" ), "../src/test/test-extract-word.c", 263, __PRETTY_FUNCTION__ ); } while (0); |
264 | free(t); |
265 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 265, __PRETTY_FUNCTION__); } while (0); |
266 | |
267 | p = original = "-N ''"; |
268 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) > 0" ), "../src/test/test-extract-word.c", 268, __PRETTY_FUNCTION__ ); } while (0); |
269 | assert_se(streq(t, "-N"))do { if ((__builtin_expect(!!(!((strcmp((t),("-N")) == 0))),0 ))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"-N\")" ), "../src/test/test-extract-word.c", 269, __PRETTY_FUNCTION__ ); } while (0); |
270 | free(t); |
271 | assert_se(p == original + 3)do { if ((__builtin_expect(!!(!(p == original + 3)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 3"), "../src/test/test-extract-word.c" , 271, __PRETTY_FUNCTION__); } while (0); |
272 | |
273 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_QUOTES) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_QUOTES) > 0" ), "../src/test/test-extract-word.c", 273, __PRETTY_FUNCTION__ ); } while (0); |
274 | assert_se(streq(t, ""))do { if ((__builtin_expect(!!(!((strcmp((t),("")) == 0))),0)) ) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\")" ), "../src/test/test-extract-word.c", 274, __PRETTY_FUNCTION__ ); } while (0); |
275 | free(t); |
276 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 276, __PRETTY_FUNCTION__); } while (0); |
277 | |
278 | p = original = ":foo\\:bar::waldo:"; |
279 | assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, \":\", EXTRACT_DONT_COALESCE_SEPARATORS) == 1" ), "../src/test/test-extract-word.c", 279, __PRETTY_FUNCTION__ ); } while (0); |
280 | assert_se(t)do { if ((__builtin_expect(!!(!(t)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("t"), "../src/test/test-extract-word.c", 280, __PRETTY_FUNCTION__); } while (0); |
281 | assert_se(streq(t, ""))do { if ((__builtin_expect(!!(!((strcmp((t),("")) == 0))),0)) ) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\")" ), "../src/test/test-extract-word.c", 281, __PRETTY_FUNCTION__ ); } while (0); |
282 | free(t); |
283 | assert_se(p == original + 1)do { if ((__builtin_expect(!!(!(p == original + 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 1"), "../src/test/test-extract-word.c" , 283, __PRETTY_FUNCTION__); } while (0); |
284 | |
285 | assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, \":\", EXTRACT_DONT_COALESCE_SEPARATORS) == 1" ), "../src/test/test-extract-word.c", 285, __PRETTY_FUNCTION__ ); } while (0); |
286 | assert_se(streq(t, "foo:bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo:bar")) == 0 ))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo:bar\")" ), "../src/test/test-extract-word.c", 286, __PRETTY_FUNCTION__ ); } while (0); |
287 | free(t); |
288 | assert_se(p == original + 10)do { if ((__builtin_expect(!!(!(p == original + 10)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 10"), "../src/test/test-extract-word.c" , 288, __PRETTY_FUNCTION__); } while (0); |
289 | |
290 | assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, \":\", EXTRACT_DONT_COALESCE_SEPARATORS) == 1" ), "../src/test/test-extract-word.c", 290, __PRETTY_FUNCTION__ ); } while (0); |
291 | assert_se(t)do { if ((__builtin_expect(!!(!(t)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("t"), "../src/test/test-extract-word.c", 291, __PRETTY_FUNCTION__); } while (0); |
292 | assert_se(streq(t, ""))do { if ((__builtin_expect(!!(!((strcmp((t),("")) == 0))),0)) ) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\")" ), "../src/test/test-extract-word.c", 292, __PRETTY_FUNCTION__ ); } while (0); |
293 | free(t); |
294 | assert_se(p == original + 11)do { if ((__builtin_expect(!!(!(p == original + 11)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 11"), "../src/test/test-extract-word.c" , 294, __PRETTY_FUNCTION__); } while (0); |
295 | |
296 | assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, \":\", EXTRACT_DONT_COALESCE_SEPARATORS) == 1" ), "../src/test/test-extract-word.c", 296, __PRETTY_FUNCTION__ ); } while (0); |
297 | assert_se(streq(t, "waldo"))do { if ((__builtin_expect(!!(!((strcmp((t),("waldo")) == 0)) ),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"waldo\")" ), "../src/test/test-extract-word.c", 297, __PRETTY_FUNCTION__ ); } while (0); |
298 | free(t); |
299 | assert_se(p == original + 17)do { if ((__builtin_expect(!!(!(p == original + 17)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 17"), "../src/test/test-extract-word.c" , 299, __PRETTY_FUNCTION__); } while (0); |
300 | |
301 | assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, \":\", EXTRACT_DONT_COALESCE_SEPARATORS) == 1" ), "../src/test/test-extract-word.c", 301, __PRETTY_FUNCTION__ ); } while (0); |
302 | assert_se(streq(t, ""))do { if ((__builtin_expect(!!(!((strcmp((t),("")) == 0))),0)) ) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\")" ), "../src/test/test-extract-word.c", 302, __PRETTY_FUNCTION__ ); } while (0); |
303 | free(t); |
304 | assert_se(p == NULL)do { if ((__builtin_expect(!!(!(p == ((void*)0))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == NULL"), "../src/test/test-extract-word.c" , 304, __PRETTY_FUNCTION__); } while (0); |
305 | |
306 | assert_se(extract_first_word(&p, &t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ":", EXTRACT_DONT_COALESCE_SEPARATORS) == 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, \":\", EXTRACT_DONT_COALESCE_SEPARATORS) == 0" ), "../src/test/test-extract-word.c", 306, __PRETTY_FUNCTION__ ); } while (0); |
307 | assert_se(!t)do { if ((__builtin_expect(!!(!(!t)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("!t"), "../src/test/test-extract-word.c" , 307, __PRETTY_FUNCTION__); } while (0); |
308 | assert_se(!p)do { if ((__builtin_expect(!!(!(!p)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("!p"), "../src/test/test-extract-word.c" , 308, __PRETTY_FUNCTION__); } while (0); |
309 | |
310 | p = "foo\\xbar"; |
311 | assert_se(extract_first_word(&p, &t, NULL, 0) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), 0) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word(&p, &t, NULL, 0) > 0"), "../src/test/test-extract-word.c" , 311, __PRETTY_FUNCTION__); } while (0); |
312 | assert_se(streq(t, "fooxbar"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooxbar")) == 0 ))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooxbar\")" ), "../src/test/test-extract-word.c", 312, __PRETTY_FUNCTION__ ); } while (0); |
313 | free(t); |
314 | assert_se(p == NULL)do { if ((__builtin_expect(!!(!(p == ((void*)0))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == NULL"), "../src/test/test-extract-word.c" , 314, __PRETTY_FUNCTION__); } while (0); |
315 | |
316 | p = "foo\\xbar"; |
317 | assert_se(extract_first_word(&p, &t, NULL, EXTRACT_RETAIN_ESCAPE) > 0)do { if ((__builtin_expect(!!(!(extract_first_word(&p, & t, ((void*)0), EXTRACT_RETAIN_ESCAPE) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word(&p, &t, NULL, EXTRACT_RETAIN_ESCAPE) > 0" ), "../src/test/test-extract-word.c", 317, __PRETTY_FUNCTION__ ); } while (0); |
318 | assert_se(streq(t, "foo\\xbar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo\\xbar")) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo\\\\xbar\")" ), "../src/test/test-extract-word.c", 318, __PRETTY_FUNCTION__ ); } while (0); |
319 | free(t); |
320 | assert_se(p == NULL)do { if ((__builtin_expect(!!(!(p == ((void*)0))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == NULL"), "../src/test/test-extract-word.c" , 320, __PRETTY_FUNCTION__); } while (0); |
321 | } |
322 | |
323 | static void test_extract_first_word_and_warn(void) { |
324 | const char *p, *original; |
325 | char *t; |
326 | |
327 | p = original = "foobar waldo"; |
328 | assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), 0, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, 0, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 328, __PRETTY_FUNCTION__ ); } while (0); |
329 | assert_se(streq(t, "foobar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foobar")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foobar\")" ), "../src/test/test-extract-word.c", 329, __PRETTY_FUNCTION__ ); } while (0); |
330 | free(t); |
331 | assert_se(p == original + 7)do { if ((__builtin_expect(!!(!(p == original + 7)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 7"), "../src/test/test-extract-word.c" , 331, __PRETTY_FUNCTION__); } while (0); |
332 | |
333 | assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), 0, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, 0, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 333, __PRETTY_FUNCTION__ ); } while (0); |
334 | assert_se(streq(t, "waldo"))do { if ((__builtin_expect(!!(!((strcmp((t),("waldo")) == 0)) ),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"waldo\")" ), "../src/test/test-extract-word.c", 334, __PRETTY_FUNCTION__ ); } while (0); |
335 | free(t); |
336 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 336, __PRETTY_FUNCTION__); } while (0); |
337 | |
338 | assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) == 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), 0, ((void*)0), "fake", 1, original) == 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, 0, NULL, \"fake\", 1, original) == 0" ), "../src/test/test-extract-word.c", 338, __PRETTY_FUNCTION__ ); } while (0); |
339 | assert_se(!t)do { if ((__builtin_expect(!!(!(!t)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("!t"), "../src/test/test-extract-word.c" , 339, __PRETTY_FUNCTION__); } while (0); |
340 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 340, __PRETTY_FUNCTION__); } while (0); |
341 | |
342 | p = original = "\"foobar\" \'waldo\'"; |
343 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 343, __PRETTY_FUNCTION__ ); } while (0); |
344 | assert_se(streq(t, "foobar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foobar")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foobar\")" ), "../src/test/test-extract-word.c", 344, __PRETTY_FUNCTION__ ); } while (0); |
345 | free(t); |
346 | assert_se(p == original + 9)do { if ((__builtin_expect(!!(!(p == original + 9)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 9"), "../src/test/test-extract-word.c" , 346, __PRETTY_FUNCTION__); } while (0); |
347 | |
348 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 348, __PRETTY_FUNCTION__ ); } while (0); |
349 | assert_se(streq(t, "waldo"))do { if ((__builtin_expect(!!(!((strcmp((t),("waldo")) == 0)) ),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"waldo\")" ), "../src/test/test-extract-word.c", 349, __PRETTY_FUNCTION__ ); } while (0); |
350 | free(t); |
351 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 351, __PRETTY_FUNCTION__); } while (0); |
352 | |
353 | assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) == 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), 0, ((void*)0), "fake", 1, original) == 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, 0, NULL, \"fake\", 1, original) == 0" ), "../src/test/test-extract-word.c", 353, __PRETTY_FUNCTION__ ); } while (0); |
354 | assert_se(!t)do { if ((__builtin_expect(!!(!(!t)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("!t"), "../src/test/test-extract-word.c" , 354, __PRETTY_FUNCTION__); } while (0); |
355 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 355, __PRETTY_FUNCTION__); } while (0); |
356 | |
357 | p = original = "\""; |
358 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, "fake", 1, original) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES, ((void*)0), "fake", 1, original) == -22)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, \"fake\", 1, original) == -EINVAL" ), "../src/test/test-extract-word.c", 358, __PRETTY_FUNCTION__ ); } while (0); |
359 | assert_se(p == original + 1)do { if ((__builtin_expect(!!(!(p == original + 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 1"), "../src/test/test-extract-word.c" , 359, __PRETTY_FUNCTION__); } while (0); |
360 | |
361 | p = original = "\'"; |
362 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, "fake", 1, original) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES, ((void*)0), "fake", 1, original) == -22)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, \"fake\", 1, original) == -EINVAL" ), "../src/test/test-extract-word.c", 362, __PRETTY_FUNCTION__ ); } while (0); |
363 | assert_se(p == original + 1)do { if ((__builtin_expect(!!(!(p == original + 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 1"), "../src/test/test-extract-word.c" , 363, __PRETTY_FUNCTION__); } while (0); |
364 | |
365 | p = original = "\'fooo"; |
366 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, "fake", 1, original) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES, ((void*)0), "fake", 1, original) == -22)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, \"fake\", 1, original) == -EINVAL" ), "../src/test/test-extract-word.c", 366, __PRETTY_FUNCTION__ ); } while (0); |
367 | assert_se(p == original + 5)do { if ((__builtin_expect(!!(!(p == original + 5)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 5"), "../src/test/test-extract-word.c" , 367, __PRETTY_FUNCTION__); } while (0); |
368 | |
369 | p = original = "\'fooo"; |
370 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES|EXTRACT_RELAX, ((void*) 0), "fake", 1, original) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 370, __PRETTY_FUNCTION__ ); } while (0); |
371 | assert_se(streq(t, "fooo"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo")) == 0))) ,0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\")" ), "../src/test/test-extract-word.c", 371, __PRETTY_FUNCTION__ ); } while (0); |
372 | free(t); |
373 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 373, __PRETTY_FUNCTION__); } while (0); |
374 | |
375 | p = original = " foo\\ba\\x6ar "; |
376 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_CUNESCAPE, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 376, __PRETTY_FUNCTION__ ); } while (0); |
377 | assert_se(streq(t, "foo\ba\x6ar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo\ba\x6ar")) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo\\ba\\x6ar\")" ), "../src/test/test-extract-word.c", 377, __PRETTY_FUNCTION__ ); } while (0); |
378 | free(t); |
379 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 379, __PRETTY_FUNCTION__); } while (0); |
380 | |
381 | p = original = " foo\\ba\\x6ar "; |
382 | assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), 0, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, 0, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 382, __PRETTY_FUNCTION__ ); } while (0); |
383 | assert_se(streq(t, "foobax6ar"))do { if ((__builtin_expect(!!(!((strcmp((t),("foobax6ar")) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foobax6ar\")" ), "../src/test/test-extract-word.c", 383, __PRETTY_FUNCTION__ ); } while (0); |
384 | free(t); |
385 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 385, __PRETTY_FUNCTION__); } while (0); |
386 | |
387 | p = original = " f\\u00f6o \"pi\\U0001F4A9le\" "; |
388 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_CUNESCAPE, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 388, __PRETTY_FUNCTION__ ); } while (0); |
389 | assert_se(streq(t, "föo"))do { if ((__builtin_expect(!!(!((strcmp((t),("föo")) == 0))) ,0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"föo\")" ), "../src/test/test-extract-word.c", 389, __PRETTY_FUNCTION__ ); } while (0); |
390 | free(t); |
391 | assert_se(p == original + 13)do { if ((__builtin_expect(!!(!(p == original + 13)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 13"), "../src/test/test-extract-word.c" , 391, __PRETTY_FUNCTION__); } while (0); |
392 | |
393 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES|EXTRACT_CUNESCAPE, ((void *)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 393, __PRETTY_FUNCTION__ ); } while (0); |
394 | assert_se(streq(t, "pi\360\237\222\251le"))do { if ((__builtin_expect(!!(!((strcmp((t),("pi\360\237\222\251le" )) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"pi\\360\\237\\222\\251le\")" ), "../src/test/test-extract-word.c", 394, __PRETTY_FUNCTION__ ); } while (0); |
395 | free(t); |
396 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 396, __PRETTY_FUNCTION__); } while (0); |
397 | |
398 | p = original = "fooo\\"; |
399 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_RELAX, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_RELAX, ((void*)0), "fake", 1, original ) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_RELAX, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 399, __PRETTY_FUNCTION__ ); } while (0); |
400 | assert_se(streq(t, "fooo"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo")) == 0))) ,0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\")" ), "../src/test/test-extract-word.c", 400, __PRETTY_FUNCTION__ ); } while (0); |
401 | free(t); |
402 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 402, __PRETTY_FUNCTION__); } while (0); |
403 | |
404 | p = original = "fooo\\"; |
405 | assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), 0, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, 0, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 405, __PRETTY_FUNCTION__ ); } while (0); |
406 | assert_se(streq(t, "fooo\\"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo\\")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\\\\\")" ), "../src/test/test-extract-word.c", 406, __PRETTY_FUNCTION__ ); } while (0); |
407 | free(t); |
408 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 408, __PRETTY_FUNCTION__); } while (0); |
409 | |
410 | p = original = "fooo\\"; |
411 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_CUNESCAPE, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 411, __PRETTY_FUNCTION__ ); } while (0); |
412 | assert_se(streq(t, "fooo\\"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo\\")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\\\\\")" ), "../src/test/test-extract-word.c", 412, __PRETTY_FUNCTION__ ); } while (0); |
413 | free(t); |
414 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 414, __PRETTY_FUNCTION__); } while (0); |
415 | |
416 | p = original = "\"foo\\"; |
417 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, "fake", 1, original) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES, ((void*)0), "fake", 1, original) == -22)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES, NULL, \"fake\", 1, original) == -EINVAL" ), "../src/test/test-extract-word.c", 417, __PRETTY_FUNCTION__ ); } while (0); |
418 | assert_se(p == original + 5)do { if ((__builtin_expect(!!(!(p == original + 5)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 5"), "../src/test/test-extract-word.c" , 418, __PRETTY_FUNCTION__); } while (0); |
419 | |
420 | p = original = "\"foo\\"; |
421 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES|EXTRACT_RELAX, ((void*) 0), "fake", 1, original) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_RELAX, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 421, __PRETTY_FUNCTION__ ); } while (0); |
422 | assert_se(streq(t, "foo"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo")) == 0))), 0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo\")" ), "../src/test/test-extract-word.c", 422, __PRETTY_FUNCTION__ ); } while (0); |
423 | free(t); |
424 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 424, __PRETTY_FUNCTION__); } while (0); |
425 | |
426 | p = original = "\"foo\\"; |
427 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE, NULL, "fake", 1, original) == -EINVAL)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES|EXTRACT_CUNESCAPE, ((void *)0), "fake", 1, original) == -22)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE, NULL, \"fake\", 1, original) == -EINVAL" ), "../src/test/test-extract-word.c", 427, __PRETTY_FUNCTION__ ); } while (0); |
428 | assert_se(p == original + 5)do { if ((__builtin_expect(!!(!(p == original + 5)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 5"), "../src/test/test-extract-word.c" , 428, __PRETTY_FUNCTION__); } while (0); |
429 | |
430 | p = original = "\"foo\\"; |
431 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE|EXTRACT_RELAX, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_QUOTES|EXTRACT_CUNESCAPE|EXTRACT_RELAX , ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_QUOTES|EXTRACT_CUNESCAPE|EXTRACT_RELAX, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 431, __PRETTY_FUNCTION__ ); } while (0); |
432 | assert_se(streq(t, "foo"))do { if ((__builtin_expect(!!(!((strcmp((t),("foo")) == 0))), 0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"foo\")" ), "../src/test/test-extract-word.c", 432, __PRETTY_FUNCTION__ ); } while (0); |
433 | free(t); |
434 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 434, __PRETTY_FUNCTION__); } while (0); |
435 | |
436 | p = original = "fooo\\ bar quux"; |
437 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_RELAX, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_RELAX, ((void*)0), "fake", 1, original ) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_RELAX, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 437, __PRETTY_FUNCTION__ ); } while (0); |
438 | assert_se(streq(t, "fooo bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo bar")) == 0 ))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo bar\")" ), "../src/test/test-extract-word.c", 438, __PRETTY_FUNCTION__ ); } while (0); |
439 | free(t); |
440 | assert_se(p == original + 10)do { if ((__builtin_expect(!!(!(p == original + 10)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 10"), "../src/test/test-extract-word.c" , 440, __PRETTY_FUNCTION__); } while (0); |
441 | |
442 | p = original = "fooo\\ bar quux"; |
443 | assert_se(extract_first_word_and_warn(&p, &t, NULL, 0, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), 0, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_first_word_and_warn(&p, &t, NULL, 0, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 443, __PRETTY_FUNCTION__ ); } while (0); |
444 | assert_se(streq(t, "fooo bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo bar")) == 0 ))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo bar\")" ), "../src/test/test-extract-word.c", 444, __PRETTY_FUNCTION__ ); } while (0); |
445 | free(t); |
446 | assert_se(p == original + 10)do { if ((__builtin_expect(!!(!(p == original + 10)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 10"), "../src/test/test-extract-word.c" , 446, __PRETTY_FUNCTION__); } while (0); |
447 | |
448 | p = original = "fooo\\ bar quux"; |
449 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_CUNESCAPE, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 449, __PRETTY_FUNCTION__ ); } while (0); |
450 | assert_se(streq(t, "fooo\\ bar"))do { if ((__builtin_expect(!!(!((strcmp((t),("fooo\\ bar")) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"fooo\\\\ bar\")" ), "../src/test/test-extract-word.c", 450, __PRETTY_FUNCTION__ ); } while (0); |
451 | free(t); |
452 | assert_se(p == original + 10)do { if ((__builtin_expect(!!(!(p == original + 10)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original + 10"), "../src/test/test-extract-word.c" , 452, __PRETTY_FUNCTION__); } while (0); |
453 | |
454 | p = original = "\\w+@\\K[\\d.]+"; |
455 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_CUNESCAPE, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 455, __PRETTY_FUNCTION__ ); } while (0); |
456 | assert_se(streq(t, "\\w+@\\K[\\d.]+"))do { if ((__builtin_expect(!!(!((strcmp((t),("\\w+@\\K[\\d.]+" )) == 0))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\\\\w+@\\\\K[\\\\d.]+\")" ), "../src/test/test-extract-word.c", 456, __PRETTY_FUNCTION__ ); } while (0); |
457 | free(t); |
458 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 458, __PRETTY_FUNCTION__); } while (0); |
459 | |
460 | p = original = "\\w+\\b"; |
461 | assert_se(extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, "fake", 1, original) > 0)do { if ((__builtin_expect(!!(!(extract_first_word_and_warn(& p, &t, ((void*)0), EXTRACT_CUNESCAPE, ((void*)0), "fake", 1, original) > 0)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD , ("extract_first_word_and_warn(&p, &t, NULL, EXTRACT_CUNESCAPE, NULL, \"fake\", 1, original) > 0" ), "../src/test/test-extract-word.c", 461, __PRETTY_FUNCTION__ ); } while (0); |
462 | assert_se(streq(t, "\\w+\b"))do { if ((__builtin_expect(!!(!((strcmp((t),("\\w+\b")) == 0) )),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq(t, \"\\\\w+\\b\")" ), "../src/test/test-extract-word.c", 462, __PRETTY_FUNCTION__ ); } while (0); |
463 | free(t); |
464 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 464, __PRETTY_FUNCTION__); } while (0); |
465 | } |
466 | |
467 | static void test_extract_many_words(void) { |
468 | const char *p, *original; |
469 | char *a, *b, *c; |
470 | |
471 | p = original = "foobar waldi piep"; |
472 | assert_se(extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 3)do { if ((__builtin_expect(!!(!(extract_many_words(&p, (( void*)0), 0, &a, &b, &c, ((void*)0)) == 3)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 3" ), "../src/test/test-extract-word.c", 472, __PRETTY_FUNCTION__ ); } while (0); |
473 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 473, __PRETTY_FUNCTION__); } while (0); |
474 | assert_se(streq_ptr(a, "foobar"))do { if ((__builtin_expect(!!(!(streq_ptr(a, "foobar"))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(a, \"foobar\")" ), "../src/test/test-extract-word.c", 474, __PRETTY_FUNCTION__ ); } while (0); |
475 | assert_se(streq_ptr(b, "waldi"))do { if ((__builtin_expect(!!(!(streq_ptr(b, "waldi"))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("streq_ptr(b, \"waldi\")"), "../src/test/test-extract-word.c" , 475, __PRETTY_FUNCTION__); } while (0); |
476 | assert_se(streq_ptr(c, "piep"))do { if ((__builtin_expect(!!(!(streq_ptr(c, "piep"))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("streq_ptr(c, \"piep\")"), "../src/test/test-extract-word.c" , 476, __PRETTY_FUNCTION__); } while (0); |
477 | free(a); |
478 | free(b); |
479 | free(c); |
480 | |
481 | p = original = "'foobar' wa\"ld\"i "; |
482 | assert_se(extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 2)do { if ((__builtin_expect(!!(!(extract_many_words(&p, (( void*)0), 0, &a, &b, &c, ((void*)0)) == 2)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 2" ), "../src/test/test-extract-word.c", 482, __PRETTY_FUNCTION__ ); } while (0); |
483 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 483, __PRETTY_FUNCTION__); } while (0); |
484 | assert_se(streq_ptr(a, "'foobar'"))do { if ((__builtin_expect(!!(!(streq_ptr(a, "'foobar'"))),0) )) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(a, \"'foobar'\")" ), "../src/test/test-extract-word.c", 484, __PRETTY_FUNCTION__ ); } while (0); |
485 | assert_se(streq_ptr(b, "wa\"ld\"i"))do { if ((__builtin_expect(!!(!(streq_ptr(b, "wa\"ld\"i"))),0 ))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(b, \"wa\\\"ld\\\"i\")" ), "../src/test/test-extract-word.c", 485, __PRETTY_FUNCTION__ ); } while (0); |
486 | assert_se(streq_ptr(c, NULL))do { if ((__builtin_expect(!!(!(streq_ptr(c, ((void*)0)))),0) )) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(c, NULL)" ), "../src/test/test-extract-word.c", 486, __PRETTY_FUNCTION__ ); } while (0); |
487 | free(a); |
488 | free(b); |
489 | |
490 | p = original = "'foobar' wa\"ld\"i "; |
491 | assert_se(extract_many_words(&p, NULL, EXTRACT_QUOTES, &a, &b, &c, NULL) == 2)do { if ((__builtin_expect(!!(!(extract_many_words(&p, (( void*)0), EXTRACT_QUOTES, &a, &b, &c, ((void*)0)) == 2)),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("extract_many_words(&p, NULL, EXTRACT_QUOTES, &a, &b, &c, NULL) == 2" ), "../src/test/test-extract-word.c", 491, __PRETTY_FUNCTION__ ); } while (0); |
492 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 492, __PRETTY_FUNCTION__); } while (0); |
493 | assert_se(streq_ptr(a, "foobar"))do { if ((__builtin_expect(!!(!(streq_ptr(a, "foobar"))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(a, \"foobar\")" ), "../src/test/test-extract-word.c", 493, __PRETTY_FUNCTION__ ); } while (0); |
494 | assert_se(streq_ptr(b, "waldi"))do { if ((__builtin_expect(!!(!(streq_ptr(b, "waldi"))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("streq_ptr(b, \"waldi\")"), "../src/test/test-extract-word.c" , 494, __PRETTY_FUNCTION__); } while (0); |
495 | assert_se(streq_ptr(c, NULL))do { if ((__builtin_expect(!!(!(streq_ptr(c, ((void*)0)))),0) )) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(c, NULL)" ), "../src/test/test-extract-word.c", 495, __PRETTY_FUNCTION__ ); } while (0); |
496 | free(a); |
497 | free(b); |
498 | |
499 | p = original = ""; |
500 | assert_se(extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 0)do { if ((__builtin_expect(!!(!(extract_many_words(&p, (( void*)0), 0, &a, &b, &c, ((void*)0)) == 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 0" ), "../src/test/test-extract-word.c", 500, __PRETTY_FUNCTION__ ); } while (0); |
501 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 501, __PRETTY_FUNCTION__); } while (0); |
502 | assert_se(streq_ptr(a, NULL))do { if ((__builtin_expect(!!(!(streq_ptr(a, ((void*)0)))),0) )) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(a, NULL)" ), "../src/test/test-extract-word.c", 502, __PRETTY_FUNCTION__ ); } while (0); |
503 | assert_se(streq_ptr(b, NULL))do { if ((__builtin_expect(!!(!(streq_ptr(b, ((void*)0)))),0) )) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(b, NULL)" ), "../src/test/test-extract-word.c", 503, __PRETTY_FUNCTION__ ); } while (0); |
504 | assert_se(streq_ptr(c, NULL))do { if ((__builtin_expect(!!(!(streq_ptr(c, ((void*)0)))),0) )) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(c, NULL)" ), "../src/test/test-extract-word.c", 504, __PRETTY_FUNCTION__ ); } while (0); |
505 | |
506 | p = original = " "; |
507 | assert_se(extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 0)do { if ((__builtin_expect(!!(!(extract_many_words(&p, (( void*)0), 0, &a, &b, &c, ((void*)0)) == 0)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_many_words(&p, NULL, 0, &a, &b, &c, NULL) == 0" ), "../src/test/test-extract-word.c", 507, __PRETTY_FUNCTION__ ); } while (0); |
508 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 508, __PRETTY_FUNCTION__); } while (0); |
509 | assert_se(streq_ptr(a, NULL))do { if ((__builtin_expect(!!(!(streq_ptr(a, ((void*)0)))),0) )) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(a, NULL)" ), "../src/test/test-extract-word.c", 509, __PRETTY_FUNCTION__ ); } while (0); |
510 | assert_se(streq_ptr(b, NULL))do { if ((__builtin_expect(!!(!(streq_ptr(b, ((void*)0)))),0) )) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(b, NULL)" ), "../src/test/test-extract-word.c", 510, __PRETTY_FUNCTION__ ); } while (0); |
511 | assert_se(streq_ptr(c, NULL))do { if ((__builtin_expect(!!(!(streq_ptr(c, ((void*)0)))),0) )) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(c, NULL)" ), "../src/test/test-extract-word.c", 511, __PRETTY_FUNCTION__ ); } while (0); |
512 | |
513 | p = original = "foobar"; |
514 | assert_se(extract_many_words(&p, NULL, 0, NULL) == 0)do { if ((__builtin_expect(!!(!(extract_many_words(&p, (( void*)0), 0, ((void*)0)) == 0)),0))) log_assert_failed_realm( LOG_REALM_SYSTEMD, ("extract_many_words(&p, NULL, 0, NULL) == 0" ), "../src/test/test-extract-word.c", 514, __PRETTY_FUNCTION__ ); } while (0); |
515 | assert_se(p == original)do { if ((__builtin_expect(!!(!(p == original)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original"), "../src/test/test-extract-word.c" , 515, __PRETTY_FUNCTION__); } while (0); |
516 | |
517 | p = original = "foobar waldi"; |
518 | assert_se(extract_many_words(&p, NULL, 0, &a, NULL) == 1)do { if ((__builtin_expect(!!(!(extract_many_words(&p, (( void*)0), 0, &a, ((void*)0)) == 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_many_words(&p, NULL, 0, &a, NULL) == 1" ), "../src/test/test-extract-word.c", 518, __PRETTY_FUNCTION__ ); } while (0); |
519 | assert_se(p == original+7)do { if ((__builtin_expect(!!(!(p == original+7)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("p == original+7"), "../src/test/test-extract-word.c" , 519, __PRETTY_FUNCTION__); } while (0); |
520 | assert_se(streq_ptr(a, "foobar"))do { if ((__builtin_expect(!!(!(streq_ptr(a, "foobar"))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(a, \"foobar\")" ), "../src/test/test-extract-word.c", 520, __PRETTY_FUNCTION__ ); } while (0); |
521 | free(a); |
522 | |
523 | p = original = " foobar "; |
524 | assert_se(extract_many_words(&p, NULL, 0, &a, NULL) == 1)do { if ((__builtin_expect(!!(!(extract_many_words(&p, (( void*)0), 0, &a, ((void*)0)) == 1)),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("extract_many_words(&p, NULL, 0, &a, NULL) == 1" ), "../src/test/test-extract-word.c", 524, __PRETTY_FUNCTION__ ); } while (0); |
525 | assert_se(isempty(p))do { if ((__builtin_expect(!!(!(isempty(p))),0))) log_assert_failed_realm (LOG_REALM_SYSTEMD, ("isempty(p)"), "../src/test/test-extract-word.c" , 525, __PRETTY_FUNCTION__); } while (0); |
526 | assert_se(streq_ptr(a, "foobar"))do { if ((__builtin_expect(!!(!(streq_ptr(a, "foobar"))),0))) log_assert_failed_realm(LOG_REALM_SYSTEMD, ("streq_ptr(a, \"foobar\")" ), "../src/test/test-extract-word.c", 526, __PRETTY_FUNCTION__ ); } while (0); |
527 | free(a); |
528 | } |
529 | |
530 | int main(int argc, char *argv[]) { |
531 | log_parse_environment()log_parse_environment_realm(LOG_REALM_SYSTEMD); |
532 | log_open(); |
533 | |
534 | test_extract_first_word(); |
535 | test_extract_first_word_and_warn(); |
536 | test_extract_many_words(); |
537 | |
538 | return 0; |
539 | } |