1 // SPDX-License-Identifier: GPL-2.0
2 #include <test_progs.h>
3 #include "timer_crash.skel.h"
10 static void test_timer_crash_mode(int mode)
12 struct timer_crash *skel;
14 skel = timer_crash__open_and_load();
15 if (!ASSERT_OK_PTR(skel, "timer_crash__open_and_load"))
17 skel->bss->pid = getpid();
18 skel->bss->crash_map = mode;
19 if (!ASSERT_OK(timer_crash__attach(skel), "timer_crash__attach"))
23 timer_crash__destroy(skel);
26 void test_timer_crash(void)
28 if (test__start_subtest("array"))
29 test_timer_crash_mode(MODE_ARRAY);
30 if (test__start_subtest("hash"))
31 test_timer_crash_mode(MODE_HASH);