MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / TEST_BEGIN

Function TEST_BEGIN

deps/jemalloc/test/unit/SFMT.c:1484–1518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1482 fini_gen_rand(ctx);
1483}
1484TEST_END
1485
1486TEST_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}
1519TEST_END
1520
1521TEST_BEGIN(test_gen_rand_64) {

Callers

nothing calls this directly

Calls 10

JEMALLOC_ATTRFunction · 0.50
get_min_array_size32Function · 0.50
init_by_arrayFunction · 0.50
fill_array32Function · 0.50
fini_gen_randFunction · 0.50
gen_rand32Function · 0.50
get_min_array_size64Function · 0.50
init_gen_randFunction · 0.50
fill_array64Function · 0.50
gen_rand64Function · 0.50

Tested by

no test coverage detected