Lines Matching full:set
17 sigset_t set; in ZTEST() local
19 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
20 set.sig[i] = -1; in ZTEST()
23 zassert_ok(sigemptyset(&set)); in ZTEST()
25 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
26 zassert_equal(set.sig[i], 0u, "set.sig[%d] is not empty: 0x%lx", i, set.sig[i]); in ZTEST()
32 sigset_t set = (sigset_t){0}; in ZTEST()
34 zassert_ok(sigfillset(&set)); in ZTEST()
36 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
37 zassert_equal(set.sig[i], -1, "set.sig[%d] is not filled: 0x%lx", i, set.sig[i]); in ZTEST()
43 sigset_t set = (sigset_t){0}; in ZTEST()
45 zassert_equal(sigaddset(&set, -1), -1, "rc should be -1"); in ZTEST()
48 zassert_equal(sigaddset(&set, 0), -1, "rc should be -1"); in ZTEST()
51 zassert_equal(sigaddset(&set, _NSIG), -1, "rc should be -1"); in ZTEST()
58 sigset_t set = (sigset_t){0}; in ZTEST()
62 zassert_ok(sigaddset(&set, signo)); in ZTEST()
64 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
65 zassert_equal(set.sig[i], target.sig[i], in ZTEST()
66 "set.sig[%d of %d] has content: %lx, expected %lx", i, in ZTEST()
67 ARRAY_SIZE(set.sig) - 1, set.sig[i], target.sig[i]); in ZTEST()
71 zassert_ok(sigaddset(&set, signo)); in ZTEST()
73 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
74 zassert_equal(set.sig[i], target.sig[i], in ZTEST()
75 "set.sig[%d of %d] has content: %lx, expected %lx", i, in ZTEST()
76 ARRAY_SIZE(set.sig) - 1, set.sig[i], target.sig[i]); in ZTEST()
79 signo = SIGRTMIN; /* >=32, will be in the second sig set for 32bit */ in ZTEST()
80 zassert_ok(sigaddset(&set, signo)); in ZTEST()
86 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
87 zassert_equal(set.sig[i], target.sig[i], in ZTEST()
88 "set.sig[%d of %d] has content: %lx, expected %lx", i, in ZTEST()
89 ARRAY_SIZE(set.sig) - 1, set.sig[i], target.sig[i]); in ZTEST()
93 zassert_ok(sigaddset(&set, signo)); in ZTEST()
95 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
96 zassert_equal(set.sig[i], target.sig[i], in ZTEST()
97 "set.sig[%d of %d] has content: %lx, expected %lx", i, in ZTEST()
98 ARRAY_SIZE(set.sig) - 1, set.sig[i], target.sig[i]); in ZTEST()
104 sigset_t set = (sigset_t){0}; in ZTEST()
106 zassert_equal(sigdelset(&set, -1), -1, "rc should be -1"); in ZTEST()
109 zassert_equal(sigdelset(&set, 0), -1, "rc should be -1"); in ZTEST()
112 zassert_equal(sigdelset(&set, _NSIG), -1, "rc should be -1"); in ZTEST()
119 sigset_t set = (sigset_t){0}; in ZTEST()
123 zassert_ok(sigdelset(&set, signo)); in ZTEST()
125 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
126 zassert_equal(set.sig[i], target.sig[i], in ZTEST()
127 "set.sig[%d of %d] has content: %lx, expected %lx", i, in ZTEST()
128 ARRAY_SIZE(set.sig) - 1, set.sig[i], target.sig[i]); in ZTEST()
132 zassert_ok(sigdelset(&set, signo)); in ZTEST()
134 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
135 zassert_equal(set.sig[i], target.sig[i], in ZTEST()
136 "set.sig[%d of %d] has content: %lx, expected %lx", i, in ZTEST()
137 ARRAY_SIZE(set.sig) - 1, set.sig[i], target.sig[i]); in ZTEST()
140 signo = SIGRTMIN; /* >=32, will be in the second sig set for 32bit */ in ZTEST()
141 zassert_ok(sigdelset(&set, signo)); in ZTEST()
147 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
148 zassert_equal(set.sig[i], target.sig[i], in ZTEST()
149 "set.sig[%d of %d] has content: %lx, expected %lx", i, in ZTEST()
150 ARRAY_SIZE(set.sig) - 1, set.sig[i], target.sig[i]); in ZTEST()
154 zassert_ok(sigdelset(&set, signo)); in ZTEST()
156 for (int i = 0; i < ARRAY_SIZE(set.sig); i++) { in ZTEST()
157 zassert_equal(set.sig[i], target.sig[i], in ZTEST()
158 "set.sig[%d of %d] has content: %lx, expected %lx", i, in ZTEST()
159 ARRAY_SIZE(set.sig) - 1, set.sig[i], target.sig[i]); in ZTEST()
165 sigset_t set = {0}; in ZTEST() local
167 zassert_equal(sigismember(&set, -1), -1, "rc should be -1"); in ZTEST()
170 zassert_equal(sigismember(&set, 0), -1, "rc should be -1"); in ZTEST()
173 zassert_equal(sigismember(&set, _NSIG), -1, "rc should be -1"); in ZTEST()
179 sigset_t set = (sigset_t){0}; in ZTEST()
182 set.sig[0] = BIT(SIGHUP) | BIT(SIGSYS) | BIT(SIGRTMIN); in ZTEST()
184 set.sig[0] = BIT(SIGHUP) | BIT(SIGSYS); in ZTEST()
185 set.sig[1] = BIT((SIGRTMIN)-BITS_PER_LONG); in ZTEST()
187 WRITE_BIT(set.sig[SIGRTMAX / BITS_PER_LONG], SIGRTMAX % BITS_PER_LONG, 1); in ZTEST()
189 zassert_equal(sigismember(&set, SIGHUP), 1, "%s expected to be member", "SIGHUP"); in ZTEST()
190 zassert_equal(sigismember(&set, SIGSYS), 1, "%s expected to be member", "SIGSYS"); in ZTEST()
191 zassert_equal(sigismember(&set, SIGRTMIN), 1, "%s expected to be member", "SIGRTMIN"); in ZTEST()
192 zassert_equal(sigismember(&set, SIGRTMAX), 1, "%s expected to be member", "SIGRTMAX"); in ZTEST()
194 zassert_equal(sigismember(&set, SIGKILL), 0, "%s not expected to be member", "SIGKILL"); in ZTEST()
195 zassert_equal(sigismember(&set, SIGTERM), 0, "%s not expected to be member", "SIGTERM"); in ZTEST()
222 typedef int (*sigmask_fn)(int how, const sigset_t *set, sigset_t *oset);
232 static sigset_t set[2]; in test_sigmask_entry() local
238 zassert_equal(sigmask(invalid_how, &set[NEW], &set[OLD]), EINVAL); in test_sigmask_entry()
241 zassert_ok(sigemptyset(&set[NEW])); in test_sigmask_entry()
242 zassert_ok(sigmask(SIG_SETMASK, &set[NEW], NULL)); in test_sigmask_entry()
243 zassert_ok(sigfillset(&set[OLD])); in test_sigmask_entry()
244 zassert_ok(sigmask(SIG_GETMASK, NULL, &set[OLD])); in test_sigmask_entry()
245 zassert_mem_equal(&set[OLD], &set[NEW], sizeof(set[OLD])); in test_sigmask_entry()
247 zassert_ok(sigfillset(&set[NEW])); in test_sigmask_entry()
248 zassert_ok(sigmask(SIG_SETMASK, &set[NEW], NULL)); in test_sigmask_entry()
249 zassert_ok(sigemptyset(&set[OLD])); in test_sigmask_entry()
250 zassert_ok(sigmask(SIG_GETMASK, NULL, &set[OLD])); in test_sigmask_entry()
251 zassert_mem_equal(&set[OLD], &set[NEW], sizeof(set[OLD])); in test_sigmask_entry()
254 zassert_ok(sigemptyset(&set[NEW])); in test_sigmask_entry()
255 zassert_ok(sigmask(SIG_SETMASK, &set[NEW], NULL)); in test_sigmask_entry()
258 zassert_ok(sigemptyset(&set[NEW])); in test_sigmask_entry()
259 zassert_ok(sigaddset(&set[NEW], SIGUSR1)); in test_sigmask_entry()
260 zassert_ok(sigmask(SIG_BLOCK, &set[NEW], NULL)); in test_sigmask_entry()
262 zassert_ok(sigemptyset(&set[NEW])); in test_sigmask_entry()
263 zassert_ok(sigaddset(&set[NEW], SIGUSR2)); in test_sigmask_entry()
264 zassert_ok(sigaddset(&set[NEW], SIGHUP)); in test_sigmask_entry()
265 zassert_ok(sigmask(SIG_BLOCK, &set[NEW], NULL)); in test_sigmask_entry()
267 zassert_ok(sigemptyset(&set[OLD])); in test_sigmask_entry()
268 zassert_ok(sigaddset(&set[OLD], SIGUSR1)); in test_sigmask_entry()
269 zassert_ok(sigaddset(&set[OLD], SIGUSR2)); in test_sigmask_entry()
270 zassert_ok(sigaddset(&set[OLD], SIGHUP)); in test_sigmask_entry()
272 zassert_ok(sigmask(SIG_GETMASK, NULL, &set[NEW])); in test_sigmask_entry()
273 zassert_mem_equal(&set[NEW], &set[OLD], sizeof(set[NEW])); in test_sigmask_entry()
276 zassert_ok(sigfillset(&set[NEW])); in test_sigmask_entry()
277 zassert_ok(sigmask(SIG_SETMASK, &set[NEW], NULL)); in test_sigmask_entry()
280 zassert_ok(sigemptyset(&set[NEW])); in test_sigmask_entry()
281 zassert_ok(sigaddset(&set[NEW], SIGUSR1)); in test_sigmask_entry()
282 zassert_ok(sigmask(SIG_UNBLOCK, &set[NEW], NULL)); in test_sigmask_entry()
284 zassert_ok(sigemptyset(&set[NEW])); in test_sigmask_entry()
285 zassert_ok(sigaddset(&set[NEW], SIGUSR2)); in test_sigmask_entry()
286 zassert_ok(sigaddset(&set[NEW], SIGHUP)); in test_sigmask_entry()
287 zassert_ok(sigmask(SIG_UNBLOCK, &set[NEW], NULL)); in test_sigmask_entry()
289 zassert_ok(sigfillset(&set[OLD])); in test_sigmask_entry()
290 zassert_ok(sigdelset(&set[OLD], SIGUSR1)); in test_sigmask_entry()
291 zassert_ok(sigdelset(&set[OLD], SIGUSR2)); in test_sigmask_entry()
292 zassert_ok(sigdelset(&set[OLD], SIGHUP)); in test_sigmask_entry()
294 zassert_ok(sigmask(SIG_GETMASK, NULL, &set[NEW])); in test_sigmask_entry()
295 zassert_mem_equal(&set[NEW], &set[OLD], sizeof(set[NEW])); in test_sigmask_entry()