MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_panic

Function test_panic

dpdk/app/test/test_debug.c:36–63  ·  view source on GitHub ↗

use fork() to test rte_panic() */

Source from the content-addressed store, hash-verified

34
35/* use fork() to test rte_panic() */
36static int
37test_panic(void)
38{
39 int pid;
40 int status;
41
42 pid = fork();
43
44 if (pid == 0) {
45 struct rlimit rl;
46
47 /* No need to generate a coredump when panicking. */
48 rl.rlim_cur = rl.rlim_max = 0;
49 setrlimit(RLIMIT_CORE, &rl);
50 rte_panic("Test Debug\n");
51 } else if (pid < 0) {
52 printf("Fork Failed\n");
53 return -1;
54 }
55 wait(&status);
56 if(status == 0){
57 printf("Child process terminated normally!\n");
58 return -1;
59 } else
60 printf("Child process terminated as expected - Test passed!\n");
61
62 return 0;
63}
64
65/* use fork() to test rte_exit() */
66static int

Callers 1

test_debugFunction · 0.85

Calls 1

printfFunction · 0.50

Tested by

no test coverage detected