Lines Matching +full:ch3 +full:- +full:0
1 // SPDX-License-Identifier: GPL-2.0-only
17 #define TEMPL "/tmp/perf-test-XXXXXX"
24 ret = -1; \
26 } while (0)
33 ret = -1; \
35 } while (0)
44 if (fd < 0) { in make_test_file()
46 return -1; in make_test_file()
52 return -1; in make_test_file()
55 return 0; in make_test_file()
62 return -1; in setup_test()
64 io->fd = open(path, O_RDONLY); in setup_test()
65 if (io->fd < 0) { in setup_test()
68 return -1; in setup_test()
70 io->buf = malloc(buf_size); in setup_test()
71 if (io->buf == NULL) { in setup_test()
73 close(io->fd); in setup_test()
75 return -1; in setup_test()
77 io__init(io, io->fd, io->buf, buf_size); in setup_test()
78 return 0; in setup_test()
83 zfree(&io->buf); in cleanup_test()
84 close(io->fd); in cleanup_test()
92 int ch, ret = 0; in do_test_get_char()
96 return -1; in do_test_get_char()
98 for (i = 0; i < strlen(test_string); i++) { in do_test_get_char()
105 EXPECT_EQUAL(ch, -1); in do_test_get_char()
114 int i, ret = 0; in test_get_char()
122 for (i = 0; i <= 10; i++) { in test_get_char()
123 for (j = 0; j < ARRAY_SIZE(test_strings); j++) { in test_get_char()
125 ret = -1; in test_get_char()
134 __u64 val3, int ch3, in do_test_get_hex() argument
139 int ch, ret = 0; in do_test_get_hex()
143 return -1; in do_test_get_hex()
155 EXPECT_EQUAL(ch, ch3); in do_test_get_hex()
165 int ret = 0; in test_get_hex()
168 0x12345678abcdef90, -1, in test_get_hex()
169 0, -1, in test_get_hex()
170 0, -1, in test_get_hex()
172 ret = -1; in test_get_hex()
179 ret = -1; in test_get_hex()
182 0x12345678abcdef90, ';', in test_get_hex()
183 0xa, ';', in test_get_hex()
184 0xb, -1, in test_get_hex()
186 ret = -1; in test_get_hex()
188 if (do_test_get_hex("0x1x2x", in test_get_hex()
189 0, 'x', in test_get_hex()
193 ret = -1; in test_get_hex()
196 0, -2, in test_get_hex()
198 0, -1, in test_get_hex()
200 ret = -1; in test_get_hex()
203 0xabcdef, 'g', in test_get_hex()
204 0, -2, in test_get_hex()
205 0x99, 'i', in test_get_hex()
207 ret = -1; in test_get_hex()
215 __u64 val3, int ch3, in do_test_get_dec() argument
220 int ch, ret = 0; in do_test_get_dec()
224 return -1; in do_test_get_dec()
236 EXPECT_EQUAL(ch, ch3); in do_test_get_dec()
246 int ret = 0; in test_get_dec()
250 0, -2, in test_get_dec()
251 0, -2, in test_get_dec()
253 ret = -1; in test_get_dec()
260 ret = -1; in test_get_dec()
265 2, -1, in test_get_dec()
267 ret = -1; in test_get_dec()
269 if (do_test_get_dec("0x1x2x", in test_get_dec()
270 0, 'x', in test_get_dec()
274 ret = -1; in test_get_dec()
277 0, -2, in test_get_dec()
279 0, -1, in test_get_dec()
281 ret = -1; in test_get_dec()
285 0, -2, in test_get_dec()
288 ret = -1; in test_get_dec()
299 size_t i, line_len = 0; in test_get_line()
301 int ret = 0; in test_get_line()
303 for (i = 0; i < 512; i++) in test_get_line()
308 test_string[1023] = '\0'; in test_get_line()
311 return -1; in test_get_line()
315 for (i = 0; i < 512; i++) in test_get_line()
319 for (i = 0; i < 510; i++) in test_get_line()
330 int ret = 0; in test__api_io()