• Home
  • Raw
  • Download

Lines Matching refs:test

35 #define KCSAN_TEST_REQUIRES(test, cond) do {			\  argument
37 kunit_skip((test), "Test requires: " #cond); \
525 static void test_barrier_nothreads(struct kunit *test) in test_barrier_nothreads() argument
535 KCSAN_TEST_REQUIRES(test, reorder_access != NULL); in test_barrier_nothreads()
536 KCSAN_TEST_REQUIRES(test, IS_ENABLED(CONFIG_SMP)); in test_barrier_nothreads()
543 KUNIT_EXPECT_EQ_MSG(test, reorder_access->size, \ in test_barrier_nothreads()
564 KUNIT_ASSERT_EQ(test, reorder_access->size, sizeof(test_var)); in test_barrier_nothreads()
713 static void test_basic(struct kunit *test) in test_basic() argument
735 KUNIT_EXPECT_TRUE(test, match_expect); in test_basic()
736 KUNIT_EXPECT_FALSE(test, match_never); in test_basic()
744 static void test_concurrent_races(struct kunit *test) in test_concurrent_races() argument
767 KUNIT_EXPECT_TRUE(test, match_expect); /* Sanity check matches exist. */ in test_concurrent_races()
768 KUNIT_EXPECT_FALSE(test, match_never); in test_concurrent_races()
773 static void test_novalue_change(struct kunit *test) in test_novalue_change() argument
795 KUNIT_EXPECT_FALSE(test, match_expect); in test_novalue_change()
797 KUNIT_EXPECT_TRUE(test, match_expect); in test_novalue_change()
805 static void test_novalue_change_exception(struct kunit *test) in test_novalue_change_exception() argument
826 KUNIT_EXPECT_TRUE(test, match_expect); in test_novalue_change_exception()
831 static void test_unknown_origin(struct kunit *test) in test_unknown_origin() argument
846 KUNIT_EXPECT_TRUE(test, match_expect); in test_unknown_origin()
848 KUNIT_EXPECT_FALSE(test, match_expect); in test_unknown_origin()
853 static void test_write_write_assume_atomic(struct kunit *test) in test_write_write_assume_atomic() argument
869 KUNIT_EXPECT_FALSE(test, match_expect); in test_write_write_assume_atomic()
871 KUNIT_EXPECT_TRUE(test, match_expect); in test_write_write_assume_atomic()
879 static void test_write_write_struct(struct kunit *test) in test_write_write_struct() argument
893 KUNIT_EXPECT_TRUE(test, match_expect); in test_write_write_struct()
901 static void test_write_write_struct_part(struct kunit *test) in test_write_write_struct_part() argument
915 KUNIT_EXPECT_TRUE(test, match_expect); in test_write_write_struct_part()
920 static void test_read_atomic_write_atomic(struct kunit *test) in test_read_atomic_write_atomic() argument
928 KUNIT_EXPECT_FALSE(test, match_never); in test_read_atomic_write_atomic()
933 static void test_read_plain_atomic_write(struct kunit *test) in test_read_plain_atomic_write() argument
943 KCSAN_TEST_REQUIRES(test, !IS_ENABLED(CONFIG_KCSAN_IGNORE_ATOMICS)); in test_read_plain_atomic_write()
949 KUNIT_EXPECT_TRUE(test, match_expect); in test_read_plain_atomic_write()
954 static void test_read_plain_atomic_rmw(struct kunit *test) in test_read_plain_atomic_rmw() argument
965 KCSAN_TEST_REQUIRES(test, !IS_ENABLED(CONFIG_KCSAN_IGNORE_ATOMICS)); in test_read_plain_atomic_rmw()
971 KUNIT_EXPECT_TRUE(test, match_expect); in test_read_plain_atomic_rmw()
976 static void test_zero_size_access(struct kunit *test) in test_zero_size_access() argument
998 KUNIT_EXPECT_TRUE(test, match_expect); /* Sanity check. */ in test_zero_size_access()
999 KUNIT_EXPECT_FALSE(test, match_never); in test_zero_size_access()
1004 static void test_data_race(struct kunit *test) in test_data_race() argument
1012 KUNIT_EXPECT_FALSE(test, match_never); in test_data_race()
1016 static void test_assert_exclusive_writer(struct kunit *test) in test_assert_exclusive_writer() argument
1030 KUNIT_EXPECT_TRUE(test, match_expect); in test_assert_exclusive_writer()
1034 static void test_assert_exclusive_access(struct kunit *test) in test_assert_exclusive_access() argument
1048 KUNIT_EXPECT_TRUE(test, match_expect); in test_assert_exclusive_access()
1052 static void test_assert_exclusive_access_writer(struct kunit *test) in test_assert_exclusive_access_writer() argument
1082 KUNIT_EXPECT_TRUE(test, match_expect_access_writer); in test_assert_exclusive_access_writer()
1083 KUNIT_EXPECT_TRUE(test, match_expect_access_access); in test_assert_exclusive_access_writer()
1084 KUNIT_EXPECT_FALSE(test, match_never); in test_assert_exclusive_access_writer()
1088 static void test_assert_exclusive_bits_change(struct kunit *test) in test_assert_exclusive_bits_change() argument
1103 KUNIT_EXPECT_TRUE(test, match_expect); in test_assert_exclusive_bits_change()
1107 static void test_assert_exclusive_bits_nochange(struct kunit *test) in test_assert_exclusive_bits_nochange() argument
1115 KUNIT_EXPECT_FALSE(test, match_never); in test_assert_exclusive_bits_nochange()
1119 static void test_assert_exclusive_writer_scoped(struct kunit *test) in test_assert_exclusive_writer_scoped() argument
1141 KUNIT_EXPECT_TRUE(test, match_expect_start); in test_assert_exclusive_writer_scoped()
1142 KUNIT_EXPECT_FALSE(test, match_expect_inscope); in test_assert_exclusive_writer_scoped()
1146 static void test_assert_exclusive_access_scoped(struct kunit *test) in test_assert_exclusive_access_scoped() argument
1172 KUNIT_EXPECT_TRUE(test, match_expect_start); in test_assert_exclusive_access_scoped()
1173 KUNIT_EXPECT_FALSE(test, match_expect_inscope); in test_assert_exclusive_access_scoped()
1182 static void test_jiffies_noreport(struct kunit *test) in test_jiffies_noreport() argument
1190 KUNIT_EXPECT_FALSE(test, match_never); in test_jiffies_noreport()
1195 static void test_seqlock_noreport(struct kunit *test) in test_seqlock_noreport() argument
1203 KUNIT_EXPECT_FALSE(test, match_never); in test_seqlock_noreport()
1213 static void test_atomic_builtins(struct kunit *test) in test_atomic_builtins() argument
1224 KUNIT_EXPECT_EQ(test, 42L, __atomic_load_n(&test_var, __ATOMIC_RELAXED)); in test_atomic_builtins()
1226 KUNIT_EXPECT_EQ(test, 42L, __atomic_exchange_n(&test_var, 20, __ATOMIC_RELAXED)); in test_atomic_builtins()
1227 KUNIT_EXPECT_EQ(test, 20L, test_var); in test_atomic_builtins()
1230 KUNIT_EXPECT_TRUE(test, __atomic_compare_exchange_n(&test_var, &tmp, 30L, in test_atomic_builtins()
1233 KUNIT_EXPECT_EQ(test, tmp, 20L); in test_atomic_builtins()
1234 KUNIT_EXPECT_EQ(test, test_var, 30L); in test_atomic_builtins()
1235 KUNIT_EXPECT_FALSE(test, __atomic_compare_exchange_n(&test_var, &tmp, 40L, in test_atomic_builtins()
1238 KUNIT_EXPECT_EQ(test, tmp, 30L); in test_atomic_builtins()
1239 KUNIT_EXPECT_EQ(test, test_var, 30L); in test_atomic_builtins()
1241 KUNIT_EXPECT_EQ(test, 30L, __atomic_fetch_add(&test_var, 1, __ATOMIC_RELAXED)); in test_atomic_builtins()
1242 KUNIT_EXPECT_EQ(test, 31L, __atomic_fetch_sub(&test_var, 1, __ATOMIC_RELAXED)); in test_atomic_builtins()
1243 KUNIT_EXPECT_EQ(test, 30L, __atomic_fetch_and(&test_var, 0xf, __ATOMIC_RELAXED)); in test_atomic_builtins()
1244 KUNIT_EXPECT_EQ(test, 14L, __atomic_fetch_xor(&test_var, 0xf, __ATOMIC_RELAXED)); in test_atomic_builtins()
1245 KUNIT_EXPECT_EQ(test, 1L, __atomic_fetch_or(&test_var, 0xf0, __ATOMIC_RELAXED)); in test_atomic_builtins()
1246 KUNIT_EXPECT_EQ(test, 241L, __atomic_fetch_nand(&test_var, 0xf, __ATOMIC_RELAXED)); in test_atomic_builtins()
1247 KUNIT_EXPECT_EQ(test, -2L, test_var); in test_atomic_builtins()
1256 KUNIT_EXPECT_FALSE(test, match_never); in test_atomic_builtins()
1260 static void test_1bit_value_change(struct kunit *test) in test_1bit_value_change() argument
1277 KUNIT_EXPECT_FALSE(test, match); in test_1bit_value_change()
1279 KUNIT_EXPECT_TRUE(test, match); in test_1bit_value_change()
1283 static void test_correct_barrier(struct kunit *test) in test_correct_barrier() argument
1298 KUNIT_EXPECT_FALSE(test, match_expect); in test_correct_barrier()
1302 static void test_missing_barrier(struct kunit *test) in test_missing_barrier() argument
1318 KUNIT_EXPECT_TRUE(test, match_expect); in test_missing_barrier()
1320 KUNIT_EXPECT_FALSE(test, match_expect); in test_missing_barrier()
1324 static void test_atomic_builtins_correct_barrier(struct kunit *test) in test_atomic_builtins_correct_barrier() argument
1340 KUNIT_EXPECT_FALSE(test, match_expect); in test_atomic_builtins_correct_barrier()
1344 static void test_atomic_builtins_missing_barrier(struct kunit *test) in test_atomic_builtins_missing_barrier() argument
1361 KUNIT_EXPECT_TRUE(test, match_expect); in test_atomic_builtins_missing_barrier()
1363 KUNIT_EXPECT_FALSE(test, match_expect); in test_atomic_builtins_missing_barrier()
1497 static int test_init(struct kunit *test) in test_init() argument
1509 if (strstr(test->name, "nothreads")) in test_init()
1512 if (!torture_init_begin((char *)test->name, 1)) in test_init()
1523 nthreads = abs((long)test->param_value); in test_init()
1549 static void test_exit(struct kunit *test) in test_exit() argument
1554 if (strstr(test->name, "nothreads")) in test_exit()