/linux/include/kunit/ |
A D | test.h | 170 void (*run_case)(struct kunit *test); 241 int (*init)(struct kunit *test); 242 void (*exit)(struct kunit *test); 727 (test)->name, ##__VA_ARGS__) 738 #define kunit_info(test, fmt, ...) \ argument 749 #define kunit_warn(test, fmt, ...) \ argument 760 #define kunit_err(test, fmt, ...) \ argument 789 KUNIT_ASSERTION(test, \ 819 KUNIT_ASSERTION(test, \ 878 KUNIT_ASSERTION(test, \ [all …]
|
/linux/drivers/base/test/ |
A D | property-entry-test.c | 31 KUNIT_EXPECT_EQ(test, error, 1); in pe_test_uints() 34 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints() 35 KUNIT_EXPECT_EQ(test, val_u8, 8); in pe_test_uints() 38 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints() 42 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints() 45 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints() 48 KUNIT_EXPECT_NE(test, error, 0); in pe_test_uints() 51 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints() 55 KUNIT_EXPECT_EQ(test, error, 1); in pe_test_uints() 58 KUNIT_EXPECT_EQ(test, error, 0); in pe_test_uints() [all …]
|
/linux/lib/kunit/ |
A D | kunit-test.c | 38 test, in kunit_test_try_catch_successful_try_no_catch() 70 test, in kunit_test_try_catch_unsuccessful_try_does_catch() 84 test->priv = ctx; in kunit_try_catch_test_init() 111 struct kunit test; member 139 KUNIT_EXPECT_TRUE(test, list_empty(&ctx->test.resources)); in kunit_resource_test_init_resources() 176 &ctx->test, in kunit_resource_test_destroy_resource() 190 KUNIT_EXPECT_TRUE(test, list_empty(&ctx->test.resources)); in kunit_resource_test_destroy_resource() 210 KUNIT_EXPECT_TRUE(test, list_empty(&ctx->test.resources)); in kunit_resource_test_cleanup_resources() 325 KUNIT_EXPECT_TRUE(test, list_empty(&test->resources)); in kunit_resource_test_static() 361 KUNIT_EXPECT_TRUE(test, list_empty(&test->resources)); in kunit_resource_test_named() [all …]
|
A D | executor_test.c | 12 static void free_subsuite_at_end(struct kunit *test, 18 static void dummy_test(struct kunit *test) {} in dummy_test() argument 33 KUNIT_EXPECT_FALSE(test, filter.test_glob); in parse_filter_test() 58 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, filtered); in filter_subsuite_test() 59 free_subsuite_at_end(test, filtered); in filter_subsuite_test() 64 KUNIT_EXPECT_FALSE(test, filtered[1]); in filter_subsuite_test() 82 free_subsuite_at_end(test, filtered); in filter_subsuite_test_glob_test() 87 KUNIT_EXPECT_FALSE(test, filtered[1]); in filter_subsuite_test_glob_test() 110 KUNIT_EXPECT_FALSE_MSG(test, filtered, in filter_subsuite_to_empty_test() 118 kfree_at_end(test, suite_set->start); in kfree_subsuites_at_end() [all …]
|
A D | test.c | 93 test->name, in kunit_print_test_stats() 231 kunit_err(test, in kunit_print_string_stream() 298 kunit_abort(test); in kunit_do_assertion() 306 test->name = name; in kunit_init_test() 307 test->log = log; in kunit_init_test() 308 if (test->log) in kunit_init_test() 349 suite->exit(test); in kunit_run_case_cleanup() 363 struct kunit *test = ctx->test; in kunit_try_run_case() local 382 struct kunit *test = ctx->test; in kunit_catch_run_case() local 427 test, in kunit_run_case_catch_errors() [all …]
|
/linux/lib/ |
A D | test_kasan.c | 126 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr); in kmalloc_oob_right() 142 KUNIT_EXPECT_KASAN_FAIL(test, ptr[0] = in kmalloc_oob_right() 278 KUNIT_ASSERT_LT(test, size1, size2); in krealloc_more_oob_helper() 298 KUNIT_EXPECT_KASAN_FAIL(test, in krealloc_more_oob_helper() 310 KUNIT_ASSERT_LT(test, size2, size1); in krealloc_less_oob_helper() 327 KUNIT_EXPECT_KASAN_FAIL(test, in krealloc_less_oob_helper() 496 KUNIT_EXPECT_KASAN_FAIL(test, in kmalloc_oob_in_memset() 519 KUNIT_EXPECT_KASAN_FAIL(test, in kmalloc_memmove_negative_size() 534 KUNIT_EXPECT_KASAN_FAIL(test, in kmalloc_memmove_invalid_size() 873 KUNIT_EXPECT_KASAN_FAIL(test, in kasan_memchr() [all …]
|
A D | list-test.c | 228 KUNIT_EXPECT_EQ(test, i, 4); in list_test_list_bulk_move_tail() 234 KUNIT_EXPECT_EQ(test, i, 2); in list_test_list_bulk_move_tail() 324 KUNIT_EXPECT_EQ(test, i, 4); in list_test_list_rotate_to_front() 366 KUNIT_EXPECT_EQ(test, i, 2); in list_test_list_cut_position() 394 KUNIT_EXPECT_EQ(test, i, 1); in list_test_list_cut_before() 424 KUNIT_EXPECT_EQ(test, i, 5); in list_test_list_splice() 449 KUNIT_EXPECT_EQ(test, i, 5); in list_test_list_splice_tail() 474 KUNIT_EXPECT_EQ(test, i, 5); in list_test_list_splice_init() 501 KUNIT_EXPECT_EQ(test, i, 5); in list_test_list_splice_tail_init() 597 KUNIT_EXPECT_EQ(test, i, 3); in list_test_list_for_each() [all …]
|
A D | test_printf.c | 145 test("", &nul); in test_basic() 146 test("100%", "100%%"); in test_basic() 147 test("xxx%yyy", "xxx%cyyy", '%'); in test_basic() 186 test("", "%s%.0s", "", "123"); in test_string() 205 test("123456", "%.s", "123456"); in test_string() 340 test(buf, fmt, p); in test_hashed() 351 test("(null)", "%pE", NULL); in null_pointer() 484 test("(null)", "%pd", NULL); in dentry() 486 test("(null)", "%pD", NULL); in dentry() 519 test("(%pt?)", "%pt", &tm); in time_and_date() [all …]
|
A D | crc32test.c | 681 test[i].start, test[i].length); in crc32c_test() 689 if (test[i].crc32c_le != __crc32c_le(test[i].crc, test_buf + in crc32c_test() 690 test[i].start, test[i].length)) in crc32c_test() 717 crc_full = __crc32c_le(test[i].crc, test_buf + test[i].start, in crc32c_combine_test() 761 test[i].start, test[i].length); in crc32_test() 764 test[i].start, test[i].length); in crc32_test() 772 if (test[i].crc_le != crc32_le(test[i].crc, test_buf + in crc32_test() 773 test[i].start, test[i].length)) in crc32_test() 776 if (test[i].crc_be != crc32_be(test[i].crc, test_buf + in crc32_test() 777 test[i].start, test[i].length)) in crc32_test() [all …]
|
/linux/drivers/thunderbolt/ |
A D | test.c | 158 sw = alloc_host(test); in alloc_host_usb4() 370 host = alloc_host(test); in tb_test_path_basic() 387 host = alloc_host(test); in tb_test_path_not_connected_walk() 442 host = alloc_host(test); in tb_test_path_single_hop_walk() 500 host = alloc_host(test); in tb_test_path_daisy_chain_walk() 561 host = alloc_host(test); in tb_test_path_simple_tree_walk() 640 host = alloc_host(test); in tb_test_path_complex_tree_walk() 740 host = alloc_host(test); in tb_test_path_max_length_walk() 790 host = alloc_host(test); in tb_test_path_not_connected() 843 host = alloc_host(test); in tb_test_path_not_bonded_lane0() [all …]
|
/linux/tools/pci/ |
A D | pcitest.c | 53 if (test->barnum >= 0 && test->barnum <= 5) { in run_test() 98 if (test->msinum > 0 && test->msinum <= 32) { in run_test() 107 if (test->msixnum > 0 && test->msixnum <= 2048) { in run_test() 128 if (test->read) { in run_test() 140 if (test->copy) { in run_test() 162 test = calloc(1, sizeof(*test)); in main() 163 if (!test) { in main() 184 if (test->barnum < 0 || test->barnum > 5) in main() 192 if (test->msinum < 1 || test->msinum > 32) in main() 197 if (test->msixnum < 1 || test->msixnum > 2048) in main() [all …]
|
/linux/security/apparmor/ |
A D | policy_unpack_test.c | 120 test->priv = puf; in policy_unpack_test_init() 195 KUNIT_EXPECT_TRUE(test, in policy_unpack_test_unpack_blob_with_null_name() 209 KUNIT_EXPECT_TRUE(test, in policy_unpack_test_unpack_blob_with_name() 227 KUNIT_EXPECT_EQ(test, size, 0); in policy_unpack_test_unpack_blob_out_of_bounds() 268 KUNIT_EXPECT_EQ(test, size, 0); in policy_unpack_test_unpack_str_out_of_bounds() 282 KUNIT_EXPECT_FALSE(test, in policy_unpack_test_unpack_strdup_with_null_name() 297 KUNIT_EXPECT_FALSE(test, in policy_unpack_test_unpack_strdup_with_name() 315 KUNIT_EXPECT_EQ(test, size, 0); in policy_unpack_test_unpack_strdup_out_of_bounds() 329 KUNIT_EXPECT_TRUE(test, success); in policy_unpack_test_unpack_nameX_with_null_name() 401 struct kunit *test) in policy_unpack_test_unpack_u16_chunk_out_of_bounds_1() argument [all …]
|
/linux/drivers/misc/ |
A D | pci_endpoint_test.c | 211 test->num_irqs = irq; in pci_endpoint_test_alloc_irq_vectors() 225 test->num_irqs = 0; in pci_endpoint_test_release_irq() 238 IRQF_SHARED, test->name, test); in pci_endpoint_test_request_irq() 772 test = devm_kzalloc(dev, sizeof(*test), GFP_KERNEL); in pci_endpoint_test_probe() 773 if (!test) in pci_endpoint_test_probe() 778 test->pdev = pdev; in pci_endpoint_test_probe() 831 test->base = test->bar[test_reg_bar]; in pci_endpoint_test_probe() 832 if (!test->base) { in pci_endpoint_test_probe() 850 if (!test->name) { in pci_endpoint_test_probe() 885 kfree(test->name); in pci_endpoint_test_probe() [all …]
|
/linux/drivers/mmc/core/ |
A D | mmc_test.c | 539 if (!test->gr) in mmc_test_save_transfer_result() 602 test->area.sg_len); in mmc_test_print_avg_rate() 642 ret = mmc_test_buffer_transfer(test, test->buffer, i, 512, 1); in __mmc_test_prepare() 2941 mmc_hostname(test->card->host), mmc_card_id(test->card)); in mmc_test_run() 2980 test->gr = gr; in mmc_test_run() 3098 test = kzalloc(sizeof(*test), GFP_KERNEL); 3099 if (!test) 3108 test->card = card; 3116 if (test->buffer && test->highmem) { 3118 if (test->buffer) { [all …]
|
/linux/tools/testing/kunit/ |
A D | kunit_parser.py | 281 test.add_error( 555 message = test.name 594 print_log(test.log) 597 print_log(test.log) 646 counts = test.counts 726 test = Test() 733 test.name = "main" 791 return test 807 test = Test() 814 test.status = test.counts.get_status() [all …]
|
/linux/tools/testing/scatterlist/ |
A D | main.c | 8 struct test { struct 30 static void fail(struct test *test, struct sg_table *st, const char *cond) in fail() argument 37 test->size, test->max_seg, test->expected_segments, st->nents, in fail() 55 struct test *test, tests[] = { in main() local 86 for (i = 0, test = tests; test->expected_segments; test++, i++) { in main() 87 int left_pages = test->pfn_app ? test->num_pages : 0; in main() 92 set_pages(pages, test->pfn, test->num_pages); in main() 96 &append, pages, test->num_pages, 0, test->size, in main() 101 test->size, test->max_seg, GFP_KERNEL); in main() 109 set_pages(pages, test->pfn_app, test->num_pages); in main() [all …]
|
/linux/drivers/mmc/host/ |
A D | sdhci-of-aspeed-test.c | 10 KUNIT_EXPECT_EQ(test, 0, in aspeed_sdhci_phase_ddr52() 12 KUNIT_EXPECT_EQ(test, 0, in aspeed_sdhci_phase_ddr52() 14 KUNIT_EXPECT_EQ(test, 1, in aspeed_sdhci_phase_ddr52() 16 KUNIT_EXPECT_EQ(test, 1, in aspeed_sdhci_phase_ddr52() 18 KUNIT_EXPECT_EQ(test, 2, in aspeed_sdhci_phase_ddr52() 20 KUNIT_EXPECT_EQ(test, 3, in aspeed_sdhci_phase_ddr52() 22 KUNIT_EXPECT_EQ(test, 14, in aspeed_sdhci_phase_ddr52() 24 KUNIT_EXPECT_EQ(test, 15, in aspeed_sdhci_phase_ddr52() 26 KUNIT_EXPECT_EQ(test, 15, in aspeed_sdhci_phase_ddr52() 53 KUNIT_EXPECT_EQ(test, 0, in aspeed_sdhci_phase_hs200() [all …]
|
/linux/mm/kfence/ |
A D | kfence_test.c | 327 setup_test_cache(test, size, 0, NULL); in test_out_of_bounds_read() 361 setup_test_cache(test, size, 0, NULL); in test_out_of_bounds_write() 378 setup_test_cache(test, size, 0, NULL); in test_use_after_free_read() 393 setup_test_cache(test, size, 0, NULL); in test_double_free() 409 setup_test_cache(test, size, 0, NULL); in test_invalid_addr_free() 426 setup_test_cache(test, size, 0, NULL); in test_corruption() 516 KUNIT_EXPECT_TRUE(test, test_cache); in test_shrink_memcache() 702 KUNIT_EXPECT_FALSE(test, test_cache); in test_krealloc() 764 KUNIT_EXPECT_TRUE(test, pass); in test_memcache_alloc_bulk() 815 if (strstr(test->name, "memcache")) in test_init() [all …]
|
/linux/kernel/ |
A D | sysctl-test.c | 52 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_null_tbl_data() 61 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_null_tbl_data() 98 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_table_maxlen_unset() 107 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_table_maxlen_unset() 138 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_table_len_is_zero() 142 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_table_len_is_zero() 149 struct kunit *test) in sysctl_test_api_dointvec_table_read_but_position_set() argument 177 KUNIT_EXPECT_EQ(test, 0, len); in sysctl_test_api_dointvec_table_read_but_position_set() 307 struct kunit *test) in sysctl_test_api_dointvec_write_single_less_int_min() argument 330 KUNIT_ASSERT_LT(test, in sysctl_test_api_dointvec_write_single_less_int_min() [all …]
|
/linux/net/mptcp/ |
A D | token_test.c | 12 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, req); in build_req_sock() 23 KUNIT_ASSERT_EQ(test, 0, in mptcp_token_test_req_basic() 25 KUNIT_EXPECT_NE(test, 0, (int)req->token); in mptcp_token_test_req_basic() 38 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, icsk); in build_icsk() 48 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, ctx); in build_ctx() 57 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, msk); in build_msk() 67 struct mptcp_sock *msk = build_msk(test); in mptcp_token_test_msk_basic() 75 KUNIT_ASSERT_EQ(test, 0, in mptcp_token_test_msk_basic() 89 struct mptcp_sock *msk = build_msk(test); in mptcp_token_test_accept() 91 KUNIT_ASSERT_EQ(test, 0, in mptcp_token_test_accept() [all …]
|
/linux/tools/testing/selftests/bpf/ |
A D | xdpxceiver.c | 122 (ksft_test_result_pass("PASS: %s %s\n", mode_string(test), (test)->name)) 421 memset(test, 0, sizeof(*test)); in test_spec_init() 441 __test_spec_init(test, test->ifobj_tx, test->ifobj_rx); in test_spec_reset() 481 if (test->ifobj_tx->pkt_stream != test->pkt_stream_default) { in pkt_stream_restore_default() 483 test->ifobj_tx->pkt_stream = test->pkt_stream_default; in pkt_stream_restore_default() 485 test->ifobj_rx->pkt_stream = test->pkt_stream_default; in pkt_stream_restore_default() 1008 if (test->total_steps == test->current_step) in worker_testapp_validate_tx() 1066 if (test->total_steps == test->current_step) in worker_testapp_validate_rx() 1130 swap_directions(&test->ifobj_rx, &test->ifobj_tx); in testapp_bidi() 1133 swap_directions(&test->ifobj_rx, &test->ifobj_tx); in testapp_bidi() [all …]
|
A D | test_sock_addr.c | 1141 if (mk_sockaddr(test->domain, test->expected_ip, test->expected_port, in init_addrs() 1145 if (mk_sockaddr(test->domain, test->requested_ip, test->requested_port, in init_addrs() 1149 if (test->expected_src_ip && in init_addrs() 1150 mk_sockaddr(test->domain, test->expected_src_ip, 0, in init_addrs() 1222 if (test->type == SOCK_STREAM) { in run_connect_test_case() 1257 if (test->type != SOCK_DGRAM) in run_xmsg_test_case() 1315 progfd = test->loadfn(test); in run_test_case() 1333 switch (test->attach_type) { in run_test_case() 1336 err = run_bind_test_case(test); in run_test_case() 1340 err = run_connect_test_case(test); in run_test_case() [all …]
|
/linux/drivers/iio/test/ |
A D | iio-test-format.c | 17 char *buf = kunit_kmalloc(test, PAGE_SIZE, GFP_KERNEL); in iio_test_iio_format_value_integer() 23 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "42\n"); in iio_test_iio_format_value_integer() 27 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "-23\n"); in iio_test_iio_format_value_integer() 31 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "0\n"); in iio_test_iio_format_value_integer() 35 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "2147483647\n"); in iio_test_iio_format_value_integer() 39 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "-2147483648\n"); in iio_test_iio_format_value_integer() 44 char *buf = kunit_kmalloc(test, PAGE_SIZE, GFP_KERNEL); in iio_test_iio_format_value_fixedpoint() 53 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "1.000010\n"); in iio_test_iio_format_value_fixedpoint() 66 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "0.000012\n"); in iio_test_iio_format_value_fixedpoint() 102 char *buf = kunit_kmalloc(test, PAGE_SIZE, GFP_KERNEL); in iio_test_iio_format_value_fractional() [all …]
|
/linux/sound/soc/ |
A D | soc-topology-test.c | 252 kunit_comp->kunit = test; in snd_soc_tplg_test_load_with_null_comp() 296 kunit_comp->kunit = test; in snd_soc_tplg_test_load_with_null_ops() 360 kunit_comp->kunit = test; in snd_soc_tplg_test_load_with_null_fw() 400 kunit_comp->kunit = test; in snd_soc_tplg_test_load_empty_tplg() 451 kunit_comp->kunit = test; in snd_soc_tplg_test_load_empty_tplg_bad_magic() 507 kunit_comp->kunit = test; in snd_soc_tplg_test_load_empty_tplg_bad_abi() 563 kunit_comp->kunit = test; in snd_soc_tplg_test_load_empty_tplg_bad_size() 619 kunit_comp->kunit = test; in snd_soc_tplg_test_load_empty_tplg_bad_payload_size() 674 kunit_comp->kunit = test; in snd_soc_tplg_test_load_pcm_tplg() 725 kunit_comp->kunit = test; in snd_soc_tplg_test_load_pcm_tplg_reload_comp() [all …]
|
/linux/drivers/base/power/ |
A D | qos-test.c | 20 KUNIT_EXPECT_EQ(test, ret, 1); in freq_qos_test_min() 22 KUNIT_EXPECT_EQ(test, ret, 1); in freq_qos_test_min() 27 KUNIT_EXPECT_EQ(test, ret, 1); in freq_qos_test_min() 31 KUNIT_EXPECT_EQ(test, ret, 1); in freq_qos_test_min() 51 KUNIT_EXPECT_EQ(test, ret, 0); in freq_qos_test_maxdef() 54 KUNIT_EXPECT_EQ(test, ret, 0); in freq_qos_test_maxdef() 58 KUNIT_EXPECT_EQ(test, ret, 1); in freq_qos_test_maxdef() 63 KUNIT_EXPECT_EQ(test, ret, 0); in freq_qos_test_maxdef() 68 KUNIT_EXPECT_EQ(test, ret, 1); in freq_qos_test_maxdef() 91 KUNIT_EXPECT_EQ(test, ret, 1); in freq_qos_test_readd() [all …]
|