Lines Matching refs:p
18 _cleanup_free_ UidRange *p = NULL; in TEST() local
22 assert_se(uid_range_covers(p, n, 0, 0)); in TEST()
23 assert_se(!uid_range_covers(p, n, 0, 1)); in TEST()
24 assert_se(!uid_range_covers(p, n, 100, UINT32_MAX)); in TEST()
26 assert_se(uid_range_add_str(&p, &n, "500-999") >= 0); in TEST()
28 assert_se(p[0].start == 500); in TEST()
29 assert_se(p[0].nr == 500); in TEST()
31 assert_se(!uid_range_contains(p, n, 499)); in TEST()
32 assert_se(uid_range_contains(p, n, 500)); in TEST()
33 assert_se(uid_range_contains(p, n, 999)); in TEST()
34 assert_se(!uid_range_contains(p, n, 1000)); in TEST()
36 assert_se(!uid_range_covers(p, n, 100, 150)); in TEST()
37 assert_se(!uid_range_covers(p, n, 400, 200)); in TEST()
38 assert_se(!uid_range_covers(p, n, 499, 1)); in TEST()
39 assert_se(uid_range_covers(p, n, 500, 1)); in TEST()
40 assert_se(uid_range_covers(p, n, 501, 10)); in TEST()
41 assert_se(uid_range_covers(p, n, 999, 1)); in TEST()
42 assert_se(!uid_range_covers(p, n, 999, 2)); in TEST()
43 assert_se(!uid_range_covers(p, n, 1000, 1)); in TEST()
44 assert_se(!uid_range_covers(p, n, 1000, 100)); in TEST()
45 assert_se(!uid_range_covers(p, n, 1001, 100)); in TEST()
48 assert_se(uid_range_next_lower(p, n, &search)); in TEST()
50 assert_se(uid_range_next_lower(p, n, &search)); in TEST()
53 assert_se(uid_range_next_lower(p, n, &search)); in TEST()
55 assert_se(uid_range_next_lower(p, n, &search) == -EBUSY); in TEST()
57 assert_se(uid_range_add_str(&p, &n, "1000") >= 0); in TEST()
59 assert_se(p[0].start == 500); in TEST()
60 assert_se(p[0].nr == 501); in TEST()
62 assert_se(uid_range_add_str(&p, &n, "30-40") >= 0); in TEST()
64 assert_se(p[0].start == 30); in TEST()
65 assert_se(p[0].nr == 11); in TEST()
66 assert_se(p[1].start == 500); in TEST()
67 assert_se(p[1].nr == 501); in TEST()
69 assert_se(uid_range_add_str(&p, &n, "60-70") >= 0); in TEST()
71 assert_se(p[0].start == 30); in TEST()
72 assert_se(p[0].nr == 11); in TEST()
73 assert_se(p[1].start == 60); in TEST()
74 assert_se(p[1].nr == 11); in TEST()
75 assert_se(p[2].start == 500); in TEST()
76 assert_se(p[2].nr == 501); in TEST()
78 assert_se(uid_range_add_str(&p, &n, "20-2000") >= 0); in TEST()
80 assert_se(p[0].start == 20); in TEST()
81 assert_se(p[0].nr == 1981); in TEST()
83 assert_se(uid_range_add_str(&p, &n, "2002") >= 0); in TEST()
85 assert_se(p[0].start == 20); in TEST()
86 assert_se(p[0].nr == 1981); in TEST()
87 assert_se(p[1].start == 2002); in TEST()
88 assert_se(p[1].nr == 1); in TEST()
90 assert_se(uid_range_add_str(&p, &n, "2001") >= 0); in TEST()
92 assert_se(p[0].start == 20); in TEST()
93 assert_se(p[0].nr == 1983); in TEST()
98 _cleanup_free_ UidRange *p = NULL; in TEST() local
103 r = uid_range_load_userns(&p, &n, NULL); in TEST()
108 assert_se(uid_range_contains(p, n, getuid())); in TEST()
113 assert_se(p[0].start == 0); in TEST()
114 assert_se(p[0].nr == UINT32_MAX); in TEST()
116 assert_se(uid_range_covers(p, n, 0, UINT32_MAX)); in TEST()
124 p = mfree(p); in TEST()
127 assert_se(uid_range_load_userns(&p, &n, fn) >= 0); in TEST()
129 assert_se(uid_range_contains(p, n, 0)); in TEST()
130 assert_se(uid_range_contains(p, n, 19)); in TEST()
131 assert_se(!uid_range_contains(p, n, 20)); in TEST()
133 assert_se(!uid_range_contains(p, n, 99)); in TEST()
134 assert_se(uid_range_contains(p, n, 100)); in TEST()
135 assert_se(uid_range_contains(p, n, 119)); in TEST()
136 assert_se(!uid_range_contains(p, n, 120)); in TEST()