| 1482 | fini_gen_rand(ctx); |
| 1483 | } |
| 1484 | TEST_END |
| 1485 | |
| 1486 | TEST_BEGIN(test_by_array_32) { |
| 1487 | uint32_t array32[BLOCK_SIZE] JEMALLOC_ATTR(aligned(16)); |
| 1488 | uint32_t array32_2[BLOCK_SIZE] JEMALLOC_ATTR(aligned(16)); |
| 1489 | int i; |
| 1490 | uint32_t ini[4] = {0x1234, 0x5678, 0x9abc, 0xdef0}; |
| 1491 | uint32_t r32; |
| 1492 | sfmt_t *ctx; |
| 1493 | |
| 1494 | assert_d_le(get_min_array_size32(), BLOCK_SIZE, |
| 1495 | "Array size too small"); |
| 1496 | ctx = init_by_array(ini, 4); |
| 1497 | fill_array32(ctx, array32, BLOCK_SIZE); |
| 1498 | fill_array32(ctx, array32_2, BLOCK_SIZE); |
| 1499 | fini_gen_rand(ctx); |
| 1500 | |
| 1501 | ctx = init_by_array(ini, 4); |
| 1502 | for (i = 0; i < BLOCK_SIZE; i++) { |
| 1503 | if (i < COUNT_1) { |
| 1504 | assert_u32_eq(array32[i], init_by_array_32_expected[i], |
| 1505 | "Output mismatch for i=%d", i); |
| 1506 | } |
| 1507 | r32 = gen_rand32(ctx); |
| 1508 | assert_u32_eq(r32, array32[i], |
| 1509 | "Mismatch at array32[%d]=%x, gen=%x", i, array32[i], r32); |
| 1510 | } |
| 1511 | for (i = 0; i < COUNT_2; i++) { |
| 1512 | r32 = gen_rand32(ctx); |
| 1513 | assert_u32_eq(r32, array32_2[i], |
| 1514 | "Mismatch at array32_2[%d]=%x, gen=%x", i, array32_2[i], |
| 1515 | r32); |
| 1516 | } |
| 1517 | fini_gen_rand(ctx); |
| 1518 | } |
| 1519 | TEST_END |
| 1520 | |
| 1521 | TEST_BEGIN(test_gen_rand_64) { |
nothing calls this directly
no test coverage detected