cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

test_modules.c (691B)


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