diff options
Diffstat (limited to 'lib/test_bitmap.c')
-rw-r--r-- | lib/test_bitmap.c | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c index 431c97fb1aa0..599c6713f2a2 100644 --- a/lib/test_bitmap.c +++ b/lib/test_bitmap.c | |||
@@ -175,24 +175,41 @@ struct test_bitmap_parselist{ | |||
175 | const int flags; | 175 | const int flags; |
176 | }; | 176 | }; |
177 | 177 | ||
178 | static const unsigned long exp[] = {1, 2, 0x0000ffff, 0xffff0000, 0x55555555, | 178 | static const unsigned long exp[] __initconst = { |
179 | 0xaaaaaaaa, 0x11111111, 0x22222222, 0xffffffff, | 179 | BITMAP_FROM_U64(1), |
180 | 0xfffffffe, 0x3333333311111111, 0xffffffff77777777}; | 180 | BITMAP_FROM_U64(2), |
181 | static const unsigned long exp2[] = {0x3333333311111111, 0xffffffff77777777}; | 181 | BITMAP_FROM_U64(0x0000ffff), |
182 | BITMAP_FROM_U64(0xffff0000), | ||
183 | BITMAP_FROM_U64(0x55555555), | ||
184 | BITMAP_FROM_U64(0xaaaaaaaa), | ||
185 | BITMAP_FROM_U64(0x11111111), | ||
186 | BITMAP_FROM_U64(0x22222222), | ||
187 | BITMAP_FROM_U64(0xffffffff), | ||
188 | BITMAP_FROM_U64(0xfffffffe), | ||
189 | BITMAP_FROM_U64(0x3333333311111111), | ||
190 | BITMAP_FROM_U64(0xffffffff77777777) | ||
191 | }; | ||
192 | |||
193 | static const unsigned long exp2[] __initconst = { | ||
194 | BITMAP_FROM_U64(0x3333333311111111), | ||
195 | BITMAP_FROM_U64(0xffffffff77777777) | ||
196 | }; | ||
182 | 197 | ||
183 | static const struct test_bitmap_parselist parselist_tests[] __initconst = { | 198 | static const struct test_bitmap_parselist parselist_tests[] __initconst = { |
199 | #define step (sizeof(u64) / sizeof(unsigned long)) | ||
200 | |||
184 | {0, "0", &exp[0], 8, 0}, | 201 | {0, "0", &exp[0], 8, 0}, |
185 | {0, "1", &exp[1], 8, 0}, | 202 | {0, "1", &exp[1 * step], 8, 0}, |
186 | {0, "0-15", &exp[2], 32, 0}, | 203 | {0, "0-15", &exp[2 * step], 32, 0}, |
187 | {0, "16-31", &exp[3], 32, 0}, | 204 | {0, "16-31", &exp[3 * step], 32, 0}, |
188 | {0, "0-31:1/2", &exp[4], 32, 0}, | 205 | {0, "0-31:1/2", &exp[4 * step], 32, 0}, |
189 | {0, "1-31:1/2", &exp[5], 32, 0}, | 206 | {0, "1-31:1/2", &exp[5 * step], 32, 0}, |
190 | {0, "0-31:1/4", &exp[6], 32, 0}, | 207 | {0, "0-31:1/4", &exp[6 * step], 32, 0}, |
191 | {0, "1-31:1/4", &exp[7], 32, 0}, | 208 | {0, "1-31:1/4", &exp[7 * step], 32, 0}, |
192 | {0, "0-31:4/4", &exp[8], 32, 0}, | 209 | {0, "0-31:4/4", &exp[8 * step], 32, 0}, |
193 | {0, "1-31:4/4", &exp[9], 32, 0}, | 210 | {0, "1-31:4/4", &exp[9 * step], 32, 0}, |
194 | {0, "0-31:1/4,32-63:2/4", &exp[10], 64, 0}, | 211 | {0, "0-31:1/4,32-63:2/4", &exp[10 * step], 64, 0}, |
195 | {0, "0-31:3/4,32-63:4/4", &exp[11], 64, 0}, | 212 | {0, "0-31:3/4,32-63:4/4", &exp[11 * step], 64, 0}, |
196 | 213 | ||
197 | {0, "0-31:1/4,32-63:2/4,64-95:3/4,96-127:4/4", exp2, 128, 0}, | 214 | {0, "0-31:1/4,32-63:2/4,64-95:3/4,96-127:4/4", exp2, 128, 0}, |
198 | 215 | ||