test_modules.c 691 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0+
  2. #include <kunit/test.h>
  3. #include <linux/module.h>
  4. #include "test_modules.h"
  5. /*
  6. * Test that modules with many relocations are loaded properly.
  7. */
  8. static void test_modules_many_vmlinux_relocs(struct kunit *test)
  9. {
  10. int result = 0;
  11. #define CALL_RETURN(i) result += test_modules_return_ ## i()
  12. REPEAT_10000(CALL_RETURN);
  13. KUNIT_ASSERT_EQ(test, result, 49995000);
  14. }
  15. static struct kunit_case modules_testcases[] = {
  16. KUNIT_CASE(test_modules_many_vmlinux_relocs),
  17. {}
  18. };
  19. static struct kunit_suite modules_test_suite = {
  20. .name = "modules_test_s390",
  21. .test_cases = modules_testcases,
  22. };
  23. kunit_test_suites(&modules_test_suite);
  24. MODULE_LICENSE("GPL");