Lines Matching refs:buf
27 char buf[BUF_SIZE]; in bootm_test_nop() local
33 *buf = '\0'; in bootm_test_nop()
34 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_ALL)); in bootm_test_nop()
35 ut_asserteq_str("", buf); in bootm_test_nop()
37 strcpy(buf, "test"); in bootm_test_nop()
38 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_ALL)); in bootm_test_nop()
39 ut_asserteq_str("test", buf); in bootm_test_nop()
48 char buf[BUF_SIZE]; in bootm_test_nospace() local
54 *buf = '\0'; in bootm_test_nospace()
55 ut_asserteq(-ENOSPC, bootm_process_cmdline(buf, 0, BOOTM_CL_ALL)); in bootm_test_nospace()
58 memset(buf, 'a', BUF_SIZE); in bootm_test_nospace()
59 ut_asserteq(-ENOSPC, bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_ALL)); in bootm_test_nospace()
62 memset(buf, '\0', BUF_SIZE); in bootm_test_nospace()
63 memset(buf, 'a', BUF_SIZE / 2); in bootm_test_nospace()
64 ut_asserteq(-ENOSPC, bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_ALL)); in bootm_test_nospace()
67 memset(buf, '\0', BUF_SIZE); in bootm_test_nospace()
68 memset(buf, 'a', BUF_SIZE / 2 - 1); in bootm_test_nospace()
69 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_ALL)); in bootm_test_nospace()
78 char buf[BUF_SIZE]; in bootm_test_silent() local
85 strcpy(buf, CONSOLE_STR); in bootm_test_silent()
86 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SILENT)); in bootm_test_silent()
87 ut_asserteq_str(CONSOLE_STR, buf); in bootm_test_silent()
90 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SILENT)); in bootm_test_silent()
91 ut_asserteq_str(CONSOLE_STR, buf); in bootm_test_silent()
94 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SILENT)); in bootm_test_silent()
95 ut_asserteq_str("console=ttynull", buf); in bootm_test_silent()
98 *buf = '\0'; in bootm_test_silent()
99 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SILENT)); in bootm_test_silent()
100 ut_asserteq_str("console=ttynull", buf); in bootm_test_silent()
103 *buf = '\0'; in bootm_test_silent()
104 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, 0)); in bootm_test_silent()
105 ut_asserteq_str("", buf); in bootm_test_silent()
108 *buf = '\0'; in bootm_test_silent()
109 ut_asserteq(-ENOSPC, bootm_process_cmdline(buf, 15, BOOTM_CL_SILENT)); in bootm_test_silent()
112 *buf = '\0'; in bootm_test_silent()
113 ut_assertok(bootm_process_cmdline(buf, 16, BOOTM_CL_SILENT)); in bootm_test_silent()
116 strcpy(buf, "something"); in bootm_test_silent()
117 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SILENT)); in bootm_test_silent()
118 ut_asserteq_str("something console=ttynull", buf); in bootm_test_silent()
121 strcpy(buf, CONSOLE_STR " something"); in bootm_test_silent()
122 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SILENT)); in bootm_test_silent()
123 ut_asserteq_str("console=ttynull something", buf); in bootm_test_silent()
132 char buf[BUF_SIZE]; in bootm_test_subst() local
136 strcpy(buf, "some${var}thing"); in bootm_test_subst()
137 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SUBST)); in bootm_test_subst()
138 ut_asserteq_str("something", buf); in bootm_test_subst()
142 strcpy(buf, "some${var}thing"); in bootm_test_subst()
143 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SUBST)); in bootm_test_subst()
144 ut_asserteq_str("somebbthing", buf); in bootm_test_subst()
148 strcpy(buf, "some${var}thing"); in bootm_test_subst()
149 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SUBST)); in bootm_test_subst()
150 ut_asserteq_str("someabcthing", buf); in bootm_test_subst()
154 strcpy(buf, "some${var}thing"); in bootm_test_subst()
155 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SUBST)); in bootm_test_subst()
156 ut_asserteq_str("someabcdething", buf); in bootm_test_subst()
160 strcpy(buf, "some${VAR}thing"); in bootm_test_subst()
161 ut_assertok(bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SUBST)); in bootm_test_subst()
162 ut_asserteq_str("something", buf); in bootm_test_subst()
165 strcpy(buf, "some${var}thing"); in bootm_test_subst()
167 bootm_process_cmdline(buf, 12 * 2 - 1, BOOTM_CL_SUBST)); in bootm_test_subst()
170 strcpy(buf, "some${var}thing"); in bootm_test_subst()
171 ut_assertok(bootm_process_cmdline(buf, 16 * 2, BOOTM_CL_SUBST)); in bootm_test_subst()
172 ut_asserteq_str("someabcdething", buf); in bootm_test_subst()
180 strcpy(buf, "a${var}c"); in bootm_test_subst()
181 ut_asserteq(-ENOSPC, bootm_process_cmdline(buf, 21, BOOTM_CL_SUBST)); in bootm_test_subst()
183 strcpy(buf, "a${var}c"); in bootm_test_subst()
184 ut_asserteq(0, bootm_process_cmdline(buf, 22, BOOTM_CL_SUBST)); in bootm_test_subst()
189 strcpy(buf, "some${var}thing${bvar}else"); in bootm_test_subst()
190 ut_asserteq(0, bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SUBST)); in bootm_test_subst()
191 ut_asserteq_str("someabcthingelse", buf); in bootm_test_subst()
195 strcpy(buf, "some${var}thing${bvar}else"); in bootm_test_subst()
196 ut_asserteq(0, bootm_process_cmdline(buf, BUF_SIZE, BOOTM_CL_SUBST)); in bootm_test_subst()
197 ut_asserteq_str("someabcthing123else", buf); in bootm_test_subst()