Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0+
0002 
0003 #include <kunit/test.h>
0004 #include <linux/module.h>
0005 
0006 #include "test_modules.h"
0007 
0008 /*
0009  * Test that modules with many relocations are loaded properly.
0010  */
0011 static void test_modules_many_vmlinux_relocs(struct kunit *test)
0012 {
0013     int result = 0;
0014 
0015 #define CALL_RETURN(i) result += test_modules_return_ ## i()
0016     REPEAT_10000(CALL_RETURN);
0017     KUNIT_ASSERT_EQ(test, result, 49995000);
0018 }
0019 
0020 static struct kunit_case modules_testcases[] = {
0021     KUNIT_CASE(test_modules_many_vmlinux_relocs),
0022     {}
0023 };
0024 
0025 static struct kunit_suite modules_test_suite = {
0026     .name = "modules_test_s390",
0027     .test_cases = modules_testcases,
0028 };
0029 
0030 kunit_test_suites(&modules_test_suite);
0031 
0032 MODULE_LICENSE("GPL");