Lines Matching refs:test

1034 stdbit_test_one(const stdbit_test_t *test, const stdbit_ops_t *ops)  in stdbit_test_one()  argument
1037 uint64_t comp = test->st_res; in stdbit_test_one()
1039 VERIFY3U(test->st_types, !=, 0); in stdbit_test_one()
1040 if ((test->st_types & STDBIT_TEST_U8) != 0) { in stdbit_test_one()
1041 unsigned res = ops->so_uc(test->st_val); in stdbit_test_one()
1045 ops->so_name, test->st_val, res, comp); in stdbit_test_one()
1052 if ((test->st_types & STDBIT_TEST_U16) != 0) { in stdbit_test_one()
1053 unsigned res = ops->so_us(test->st_val); in stdbit_test_one()
1057 ops->so_name, test->st_val, res, comp); in stdbit_test_one()
1064 if ((test->st_types & STDBIT_TEST_U32) != 0) { in stdbit_test_one()
1065 unsigned res = ops->so_ui(test->st_val); in stdbit_test_one()
1069 ops->so_name, test->st_val, res, comp); in stdbit_test_one()
1074 res = ops->so_ul(test->st_val); in stdbit_test_one()
1078 ops->so_name, test->st_val, res, comp); in stdbit_test_one()
1086 if ((test->st_types & STDBIT_TEST_U64) != 0) { in stdbit_test_one()
1089 res = ops->so_ul(test->st_val); in stdbit_test_one()
1093 ops->so_name, test->st_val, res, comp); in stdbit_test_one()
1098 res = ops->so_ull(test->st_val); in stdbit_test_one()
1102 ops->so_name, test->st_val, res, comp); in stdbit_test_one()
1108 stdbit_print_pass(test->st_types, test->st_val, ops->so_name); in stdbit_test_one()
1228 stdbit_1b_test_one(const stdbit_test_t *test) in stdbit_1b_test_one() argument
1232 VERIFY(test->st_res == 0 || test->st_res == 1); in stdbit_1b_test_one()
1233 comp = (bool)test->st_res; in stdbit_1b_test_one()
1235 VERIFY3U(test->st_types, !=, 0); in stdbit_1b_test_one()
1236 if ((test->st_types & STDBIT_TEST_U8) != 0) { in stdbit_1b_test_one()
1237 bool res = stdc_has_single_bit_uc(test->st_val); in stdbit_1b_test_one()
1240 "(uchar) returned %s, expected %s", test->st_val, in stdbit_1b_test_one()
1246 if ((test->st_types & STDBIT_TEST_U16) != 0) { in stdbit_1b_test_one()
1247 bool res = stdc_has_single_bit_us(test->st_val); in stdbit_1b_test_one()
1250 "(ushort) returned %s, expected %s", test->st_val, in stdbit_1b_test_one()
1256 if ((test->st_types & STDBIT_TEST_U32) != 0) { in stdbit_1b_test_one()
1257 bool res = stdc_has_single_bit_ui(test->st_val); in stdbit_1b_test_one()
1260 "(uint) returned %s, expected %s", test->st_val, in stdbit_1b_test_one()
1266 res = stdc_has_single_bit_ul(test->st_val); in stdbit_1b_test_one()
1269 "(ulong) returned %s, expected %s", test->st_val, in stdbit_1b_test_one()
1276 if ((test->st_types & STDBIT_TEST_U64) != 0) { in stdbit_1b_test_one()
1279 res = stdc_has_single_bit_ul(test->st_val); in stdbit_1b_test_one()
1282 "(ulong) returned %s, expected %s", test->st_val, in stdbit_1b_test_one()
1288 res = stdc_has_single_bit_ull(test->st_val); in stdbit_1b_test_one()
1292 test->st_val, res ? "true" : "false", in stdbit_1b_test_one()
1299 stdbit_print_pass(test->st_types, test->st_val, "Single-bit"); in stdbit_1b_test_one()
1440 stdbit_fc_test_one(const stdbit_fc_test_t *test) in stdbit_fc_test_one() argument
1444 VERIFY3U(test->sfc_types, !=, 0); in stdbit_fc_test_one()
1445 if ((test->sfc_types & STDBIT_TEST_U8) != 0) { in stdbit_fc_test_one()
1446 uint64_t res = stdc_bit_floor_uc(test->sfc_val); in stdbit_fc_test_one()
1447 if (res != test->sfc_floor) { in stdbit_fc_test_one()
1450 PRIx64, test->sfc_val, res, test->sfc_floor); in stdbit_fc_test_one()
1454 res = stdc_bit_ceil_uc(test->sfc_val); in stdbit_fc_test_one()
1455 if (res != test->sfc_ceil) { in stdbit_fc_test_one()
1458 PRIx64, test->sfc_val, res, test->sfc_ceil); in stdbit_fc_test_one()
1463 if ((test->sfc_types & STDBIT_TEST_U16) != 0) { in stdbit_fc_test_one()
1464 uint64_t res = stdc_bit_floor_us(test->sfc_val); in stdbit_fc_test_one()
1465 if (res != test->sfc_floor) { in stdbit_fc_test_one()
1468 PRIx64, test->sfc_val, res, test->sfc_floor); in stdbit_fc_test_one()
1472 res = stdc_bit_ceil_us(test->sfc_val); in stdbit_fc_test_one()
1473 if (res != test->sfc_ceil) { in stdbit_fc_test_one()
1476 PRIx64, test->sfc_val, res, test->sfc_ceil); in stdbit_fc_test_one()
1481 if ((test->sfc_types & STDBIT_TEST_U32) != 0) { in stdbit_fc_test_one()
1482 uint64_t res = stdc_bit_floor_ui(test->sfc_val); in stdbit_fc_test_one()
1483 if (res != test->sfc_floor) { in stdbit_fc_test_one()
1486 PRIx64, test->sfc_val, res, test->sfc_floor); in stdbit_fc_test_one()
1490 res = stdc_bit_ceil_ui(test->sfc_val); in stdbit_fc_test_one()
1491 if (res != test->sfc_ceil) { in stdbit_fc_test_one()
1494 PRIx64, test->sfc_val, res, test->sfc_ceil); in stdbit_fc_test_one()
1499 res = stdc_bit_floor_ul(test->sfc_val); in stdbit_fc_test_one()
1500 if (res != test->sfc_floor) { in stdbit_fc_test_one()
1503 PRIx64, test->sfc_val, res, test->sfc_floor); in stdbit_fc_test_one()
1507 res = stdc_bit_ceil_ul(test->sfc_val); in stdbit_fc_test_one()
1508 if (res != test->sfc_ceil) { in stdbit_fc_test_one()
1511 PRIx64, test->sfc_val, res, test->sfc_ceil); in stdbit_fc_test_one()
1517 if ((test->sfc_types & STDBIT_TEST_U64) != 0) { in stdbit_fc_test_one()
1521 res = stdc_bit_floor_ul(test->sfc_val); in stdbit_fc_test_one()
1522 if (res != test->sfc_floor) { in stdbit_fc_test_one()
1525 PRIx64, test->sfc_val, res, test->sfc_floor); in stdbit_fc_test_one()
1529 res = stdc_bit_ceil_ul(test->sfc_val); in stdbit_fc_test_one()
1530 if (res != test->sfc_ceil) { in stdbit_fc_test_one()
1533 PRIx64, test->sfc_val, res, test->sfc_ceil); in stdbit_fc_test_one()
1538 res = stdc_bit_floor_ull(test->sfc_val); in stdbit_fc_test_one()
1539 if (res != test->sfc_floor) { in stdbit_fc_test_one()
1542 PRIx64, test->sfc_val, res, test->sfc_floor); in stdbit_fc_test_one()
1546 res = stdc_bit_ceil_ull(test->sfc_val); in stdbit_fc_test_one()
1547 if (res != test->sfc_ceil) { in stdbit_fc_test_one()
1550 PRIx64, test->sfc_val, res, test->sfc_ceil); in stdbit_fc_test_one()
1556 stdbit_print_pass(test->sfc_types, test->sfc_val, in stdbit_fc_test_one()