Lines Matching +full:0 +full:- +full:1023
93 int result = 0; \
113 memset(bmap, 0xff, 128); in test_zero_clear()
115 expect_eq_pbl("0-22", bmap, 23); in test_zero_clear()
116 expect_eq_pbl("0-1023", bmap, 1024); in test_zero_clear()
118 /* single-word bitmaps */ in test_zero_clear()
119 bitmap_clear(bmap, 0, 9); in test_zero_clear()
120 expect_eq_pbl("9-1023", bmap, 1024); in test_zero_clear()
123 expect_eq_pbl("64-1023", bmap, 1024); in test_zero_clear()
127 expect_eq_pbl("64-78,98-1023", bmap, 1024); in test_zero_clear()
130 expect_eq_pbl("128-1023", bmap, 1024); in test_zero_clear()
142 memset(bmap, 0x00, 128); in test_fill_set()
147 /* single-word bitmaps */ in test_fill_set()
148 bitmap_set(bmap, 0, 9); in test_fill_set()
149 expect_eq_pbl("0-8", bmap, 1024); in test_fill_set()
152 expect_eq_pbl("0-63", bmap, 1024); in test_fill_set()
156 expect_eq_pbl("0-63,79-97", bmap, 1024); in test_fill_set()
159 expect_eq_pbl("0-127", bmap, 1024); in test_fill_set()
163 expect_eq_pbl("0-1023", bmap, 1024); in test_fill_set()
174 /* single-word bitmaps */ in test_copy()
175 bitmap_set(bmap1, 0, 19); in test_copy()
177 expect_eq_pbl("0-18", bmap2, 1024); in test_copy()
179 bitmap_set(bmap2, 0, 23); in test_copy()
181 expect_eq_pbl("0-18", bmap2, 1024); in test_copy()
183 /* multi-word bitmaps */ in test_copy()
184 bitmap_set(bmap1, 0, 109); in test_copy()
186 expect_eq_pbl("0-108", bmap2, 1024); in test_copy()
190 expect_eq_pbl("0-108", bmap2, 1024); in test_copy()
192 /* the following tests assume a 32- or 64-bit arch (even 128b in test_copy()
197 bitmap_copy(bmap2, bmap1, 109); /* ... but 0-padded til word length */ in test_copy()
198 expect_eq_pbl("0-108,128-1023", bmap2, 1024); in test_copy()
202 expect_eq_pbl("0-108,128-1023", bmap2, 1024); in test_copy()
205 #define PARSE_TIME 0x1
218 BITMAP_FROM_U64(0x0000ffff),
219 BITMAP_FROM_U64(0xffff0000),
220 BITMAP_FROM_U64(0x55555555),
221 BITMAP_FROM_U64(0xaaaaaaaa),
222 BITMAP_FROM_U64(0x11111111),
223 BITMAP_FROM_U64(0x22222222),
224 BITMAP_FROM_U64(0xffffffff),
225 BITMAP_FROM_U64(0xfffffffe),
226 BITMAP_FROM_U64(0x3333333311111111ULL),
227 BITMAP_FROM_U64(0xffffffff77777777ULL)
231 BITMAP_FROM_U64(0x3333333311111111ULL),
232 BITMAP_FROM_U64(0xffffffff77777777ULL)
238 {0, "0", &exp[0], 8, 0},
239 {0, "1", &exp[1 * step], 8, 0},
240 {0, "0-15", &exp[2 * step], 32, 0},
241 {0, "16-31", &exp[3 * step], 32, 0},
242 {0, "0-31:1/2", &exp[4 * step], 32, 0},
243 {0, "1-31:1/2", &exp[5 * step], 32, 0},
244 {0, "0-31:1/4", &exp[6 * step], 32, 0},
245 {0, "1-31:1/4", &exp[7 * step], 32, 0},
246 {0, "0-31:4/4", &exp[8 * step], 32, 0},
247 {0, "1-31:4/4", &exp[9 * step], 32, 0},
248 {0, "0-31:1/4,32-63:2/4", &exp[10 * step], 64, 0},
249 {0, "0-31:3/4,32-63:4/4", &exp[11 * step], 64, 0},
251 {0, "0-31:1/4,32-63:2/4,64-95:3/4,96-127:4/4", exp2, 128, 0},
253 {0, "0-2047:128/256", NULL, 2048, PARSE_TIME},
255 {-EINVAL, "-1", NULL, 8, 0},
256 {-EINVAL, "-0", NULL, 8, 0},
257 {-EINVAL, "10-1", NULL, 8, 0},
258 {-EINVAL, "0-31:", NULL, 8, 0},
259 {-EINVAL, "0-31:0", NULL, 8, 0},
260 {-EINVAL, "0-31:0/0", NULL, 8, 0},
261 {-EINVAL, "0-31:1/0", NULL, 8, 0},
262 {-EINVAL, "0-31:10/1", NULL, 8, 0},
272 for (i = 0; i < ARRAY_SIZE(parselist_tests); i++) { in test_bitmap_parselist()
277 cycles = get_cycles() - cycles; in test_bitmap_parselist()
287 pr_err("test %d: input is %s, result is 0x%lx, expected 0x%lx\n", in test_bitmap_parselist()
288 i, ptest.in, bmap[0], *ptest.expected); in test_bitmap_parselist()
307 memset(arr, 0xa5, sizeof(arr)); in test_bitmap_arr32()
309 for (nbits = 0; nbits < EXP_BYTES; ++nbits) { in test_bitmap_arr32()
321 if (nbits < EXP_BYTES - 32) in test_bitmap_arr32()
323 0xa5a5a5a5); in test_bitmap_arr32()
333 for (start = 0; start < 1024; start += 8) { in test_mem_optimisations()
334 for (nbits = 0; nbits < 1024 - start; nbits += 8) { in test_mem_optimisations()
335 memset(bmap1, 0x5a, sizeof(bmap1)); in test_mem_optimisations()
336 memset(bmap2, 0x5a, sizeof(bmap2)); in test_mem_optimisations()
373 if (failed_tests == 0) in test_bitmap_init()
379 return failed_tests ? -EINVAL : 0; in test_bitmap_init()