Lines Matching +full:a +full:- +full:h
1 // SPDX-License-Identifier: GPL-2.0
8 #include <errno.h>
9 #include <linux/user_events.h>
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <fcntl.h>
13 #include <sys/ioctl.h>
14 #include <sys/stat.h>
15 #include <unistd.h>
17 #include "../kselftest_harness.h"
18 #include "user_events_selftests.h"
30 return -1; in event_delete()
46 if (fd == -1) in wait_for_delete()
66 if (ioctl(fd, DIAG_IOCSREG, ®) == -1) in reg_event()
67 return -1; in reg_event()
89 if (fd == -1) in parse_dyn()
90 return -1; in parse_dyn()
97 ret = -1; in parse_dyn()
112 if (fd == -1) in parse_abi()
113 return -1; in parse_abi()
118 return -1; in parse_abi()
123 if (ret != -1) { in parse_abi()
124 if (unreg_event(fd, check, 31) == -1) in parse_abi()
140 return -1; in parse()
148 int ret = -1; in check_match()
150 if (fd == -1) in check_match()
151 return -1; in check_match()
153 if (reg_event(fd, check, 31, first) == -1) in check_match()
156 if (reg_event(fd, check, 30, second) == -1) { in check_match()
182 ASSERT_NE(-1, check_match(&self->check, x, y, &match)); \
189 ASSERT_NE(-1, check_match(&self->check, x, y, &match)); \
193 #define TEST_PARSE(x) ASSERT_NE(-1, parse(&self->check, x))
195 #define TEST_NPARSE(x) ASSERT_EQ(-1, parse(&self->check, x))
203 USER_EVENT_FIXTURE_SETUP(return, self->umount); in FIXTURE_SETUP()
207 USER_EVENT_FIXTURE_TEARDOWN(self->umount); in FIXTURE_TEARDOWN()
214 TEST_PARSE("u:__test_event u64 a"); in TEST_F()
215 TEST_PARSE("u:__test_event u32 a"); in TEST_F()
216 TEST_PARSE("u:__test_event u16 a"); in TEST_F()
217 TEST_PARSE("u:__test_event u8 a"); in TEST_F()
218 TEST_PARSE("u:__test_event char a"); in TEST_F()
219 TEST_PARSE("u:__test_event unsigned char a"); in TEST_F()
220 TEST_PARSE("u:__test_event int a"); in TEST_F()
221 TEST_PARSE("u:__test_event unsigned int a"); in TEST_F()
222 TEST_PARSE("u:__test_event short a"); in TEST_F()
223 TEST_PARSE("u:__test_event unsigned short a"); in TEST_F()
224 TEST_PARSE("u:__test_event char[20] a"); in TEST_F()
225 TEST_PARSE("u:__test_event unsigned char[20] a"); in TEST_F()
226 TEST_PARSE("u:__test_event char[0x14] a"); in TEST_F()
227 TEST_PARSE("u:__test_event unsigned char[0x14] a"); in TEST_F()
229 TEST_NPARSE("u:__test_event char[aa] a"); in TEST_F()
231 TEST_NPARSE("u:__test_event char[9999] a"); in TEST_F()
233 TEST_NPARSE("u:__test_event char[0x0000000000001] a"); in TEST_F()
238 TEST_PARSE("u:__test_event __data_loc char[] a"); in TEST_F()
239 TEST_PARSE("u:__test_event __data_loc unsigned char[] a"); in TEST_F()
240 TEST_PARSE("u:__test_event __rel_loc char[] a"); in TEST_F()
241 TEST_PARSE("u:__test_event __rel_loc unsigned char[] a"); in TEST_F()
246 TEST_PARSE("u:__test_event struct custom a 20"); in TEST_F()
248 TEST_NPARSE("u:__test_event struct custom a"); in TEST_F()
249 /* Size specified on non-struct should fail */ in TEST_F()
250 TEST_NPARSE("u:__test_event char a 20"); in TEST_F()
255 TEST_MATCH("__test_event u32 a", in TEST_F()
256 "__test_event u32 a"); in TEST_F()
259 TEST_MATCH("__test_event u32 a; u32 b", in TEST_F()
260 "__test_event u32 a; u32 b"); in TEST_F()
263 TEST_MATCH("__test_event u32 a; u32 b", in TEST_F()
264 "__test_event u32 a; u32 b;"); in TEST_F()
267 TEST_NMATCH("__test_event u32 a", in TEST_F()
271 TEST_NMATCH("__test_event u32 a; u32 b", in TEST_F()
272 "__test_event u32 b; u32 a"); in TEST_F()
275 TEST_NMATCH("__test_event u64 a; u64 b", in TEST_F()
276 "__test_event u32 a; u32 b"); in TEST_F()
279 TEST_MATCH("__test_event struct my_struct a 20", in TEST_F()
280 "__test_event struct my_struct a 20"); in TEST_F()
283 TEST_NMATCH("__test_event struct my_struct a 20", in TEST_F()
287 TEST_NMATCH("__test_event struct my_struct a 20", in TEST_F()
288 "__test_event struct my_struct a 21"); in TEST_F()