Lines Matching refs:test
424 static void test_basic(struct kunit *test) in test_basic() argument
446 KUNIT_EXPECT_TRUE(test, match_expect); in test_basic()
447 KUNIT_EXPECT_FALSE(test, match_never); in test_basic()
455 static void test_concurrent_races(struct kunit *test) in test_concurrent_races() argument
478 KUNIT_EXPECT_TRUE(test, match_expect); /* Sanity check matches exist. */ in test_concurrent_races()
479 KUNIT_EXPECT_FALSE(test, match_never); in test_concurrent_races()
484 static void test_novalue_change(struct kunit *test) in test_novalue_change() argument
499 KUNIT_EXPECT_FALSE(test, match_expect); in test_novalue_change()
501 KUNIT_EXPECT_TRUE(test, match_expect); in test_novalue_change()
509 static void test_novalue_change_exception(struct kunit *test) in test_novalue_change_exception() argument
523 KUNIT_EXPECT_TRUE(test, match_expect); in test_novalue_change_exception()
528 static void test_unknown_origin(struct kunit *test) in test_unknown_origin() argument
543 KUNIT_EXPECT_TRUE(test, match_expect); in test_unknown_origin()
545 KUNIT_EXPECT_FALSE(test, match_expect); in test_unknown_origin()
550 static void test_write_write_assume_atomic(struct kunit *test) in test_write_write_assume_atomic() argument
566 KUNIT_EXPECT_FALSE(test, match_expect); in test_write_write_assume_atomic()
568 KUNIT_EXPECT_TRUE(test, match_expect); in test_write_write_assume_atomic()
576 static void test_write_write_struct(struct kunit *test) in test_write_write_struct() argument
590 KUNIT_EXPECT_TRUE(test, match_expect); in test_write_write_struct()
598 static void test_write_write_struct_part(struct kunit *test) in test_write_write_struct_part() argument
612 KUNIT_EXPECT_TRUE(test, match_expect); in test_write_write_struct_part()
617 static void test_read_atomic_write_atomic(struct kunit *test) in test_read_atomic_write_atomic() argument
625 KUNIT_EXPECT_FALSE(test, match_never); in test_read_atomic_write_atomic()
630 static void test_read_plain_atomic_write(struct kunit *test) in test_read_plain_atomic_write() argument
647 KUNIT_EXPECT_TRUE(test, match_expect); in test_read_plain_atomic_write()
652 static void test_read_plain_atomic_rmw(struct kunit *test) in test_read_plain_atomic_rmw() argument
670 KUNIT_EXPECT_TRUE(test, match_expect); in test_read_plain_atomic_rmw()
675 static void test_zero_size_access(struct kunit *test) in test_zero_size_access() argument
697 KUNIT_EXPECT_TRUE(test, match_expect); /* Sanity check. */ in test_zero_size_access()
698 KUNIT_EXPECT_FALSE(test, match_never); in test_zero_size_access()
703 static void test_data_race(struct kunit *test) in test_data_race() argument
711 KUNIT_EXPECT_FALSE(test, match_never); in test_data_race()
715 static void test_assert_exclusive_writer(struct kunit *test) in test_assert_exclusive_writer() argument
729 KUNIT_EXPECT_TRUE(test, match_expect); in test_assert_exclusive_writer()
733 static void test_assert_exclusive_access(struct kunit *test) in test_assert_exclusive_access() argument
747 KUNIT_EXPECT_TRUE(test, match_expect); in test_assert_exclusive_access()
751 static void test_assert_exclusive_access_writer(struct kunit *test) in test_assert_exclusive_access_writer() argument
781 KUNIT_EXPECT_TRUE(test, match_expect_access_writer); in test_assert_exclusive_access_writer()
782 KUNIT_EXPECT_TRUE(test, match_expect_access_access); in test_assert_exclusive_access_writer()
783 KUNIT_EXPECT_FALSE(test, match_never); in test_assert_exclusive_access_writer()
787 static void test_assert_exclusive_bits_change(struct kunit *test) in test_assert_exclusive_bits_change() argument
802 KUNIT_EXPECT_TRUE(test, match_expect); in test_assert_exclusive_bits_change()
806 static void test_assert_exclusive_bits_nochange(struct kunit *test) in test_assert_exclusive_bits_nochange() argument
814 KUNIT_EXPECT_FALSE(test, match_never); in test_assert_exclusive_bits_nochange()
818 static void test_assert_exclusive_writer_scoped(struct kunit *test) in test_assert_exclusive_writer_scoped() argument
840 KUNIT_EXPECT_TRUE(test, match_expect_start); in test_assert_exclusive_writer_scoped()
841 KUNIT_EXPECT_TRUE(test, match_expect_anywhere); in test_assert_exclusive_writer_scoped()
845 static void test_assert_exclusive_access_scoped(struct kunit *test) in test_assert_exclusive_access_scoped() argument
871 KUNIT_EXPECT_TRUE(test, match_expect_start); in test_assert_exclusive_access_scoped()
872 KUNIT_EXPECT_TRUE(test, match_expect_inscope); in test_assert_exclusive_access_scoped()
881 static void test_jiffies_noreport(struct kunit *test) in test_jiffies_noreport() argument
889 KUNIT_EXPECT_FALSE(test, match_never); in test_jiffies_noreport()
894 static void test_seqlock_noreport(struct kunit *test) in test_seqlock_noreport() argument
902 KUNIT_EXPECT_FALSE(test, match_never); in test_seqlock_noreport()
912 static void test_atomic_builtins(struct kunit *test) in test_atomic_builtins() argument
923 KUNIT_EXPECT_EQ(test, 42L, __atomic_load_n(&test_var, __ATOMIC_RELAXED)); in test_atomic_builtins()
925 KUNIT_EXPECT_EQ(test, 42L, __atomic_exchange_n(&test_var, 20, __ATOMIC_RELAXED)); in test_atomic_builtins()
926 KUNIT_EXPECT_EQ(test, 20L, test_var); in test_atomic_builtins()
929 KUNIT_EXPECT_TRUE(test, __atomic_compare_exchange_n(&test_var, &tmp, 30L, in test_atomic_builtins()
932 KUNIT_EXPECT_EQ(test, tmp, 20L); in test_atomic_builtins()
933 KUNIT_EXPECT_EQ(test, test_var, 30L); in test_atomic_builtins()
934 KUNIT_EXPECT_FALSE(test, __atomic_compare_exchange_n(&test_var, &tmp, 40L, in test_atomic_builtins()
937 KUNIT_EXPECT_EQ(test, tmp, 30L); in test_atomic_builtins()
938 KUNIT_EXPECT_EQ(test, test_var, 30L); in test_atomic_builtins()
940 KUNIT_EXPECT_EQ(test, 30L, __atomic_fetch_add(&test_var, 1, __ATOMIC_RELAXED)); in test_atomic_builtins()
941 KUNIT_EXPECT_EQ(test, 31L, __atomic_fetch_sub(&test_var, 1, __ATOMIC_RELAXED)); in test_atomic_builtins()
942 KUNIT_EXPECT_EQ(test, 30L, __atomic_fetch_and(&test_var, 0xf, __ATOMIC_RELAXED)); in test_atomic_builtins()
943 KUNIT_EXPECT_EQ(test, 14L, __atomic_fetch_xor(&test_var, 0xf, __ATOMIC_RELAXED)); in test_atomic_builtins()
944 KUNIT_EXPECT_EQ(test, 1L, __atomic_fetch_or(&test_var, 0xf0, __ATOMIC_RELAXED)); in test_atomic_builtins()
945 KUNIT_EXPECT_EQ(test, 241L, __atomic_fetch_nand(&test_var, 0xf, __ATOMIC_RELAXED)); in test_atomic_builtins()
946 KUNIT_EXPECT_EQ(test, -2L, test_var); in test_atomic_builtins()
955 KUNIT_EXPECT_FALSE(test, match_never); in test_atomic_builtins()
1006 get_num_threads(const char *test, int *nthreads) in get_num_threads() argument
1008 int len = strlen(test); in get_num_threads()
1013 *nthreads = test[len - 1] - '0'; in get_num_threads()
1014 *nthreads += (test[len - 2] - '0') * 10; in get_num_threads()
1069 static int test_init(struct kunit *test) in test_init() argument
1081 if (!torture_init_begin((char *)test->name, 1)) in test_init()
1084 if (!get_num_threads(test->name, &nthreads)) in test_init()
1106 test->name, num_online_cpus(), min_required_cpus); in test_init()
1111 test->name, nthreads); in test_init()
1141 static void test_exit(struct kunit *test) in test_exit() argument