File: exit.c

package info (click to toggle)
criterion 2.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 3,864 kB
  • sloc: ansic: 17,945; cpp: 774; python: 74; makefile: 25; sh: 19
file content (25 lines) | stat: -rw-r--r-- 379 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include <stdlib.h>
#include <criterion/criterion.h>

Test(exit, normal, .exit_code = 0) {
}

Test(exit, expected_exit, .exit_code = 42) {
    exit(42);
}

Test(exit, unexpected_exit) {
    exit(127);
}

void do_exit(void)
{
    exit(127);
}

Test(exit_with_fixtures, init_exits, .init = do_exit) {
}

Test(exit_with_fixtures, fini_exits, .fini = do_exit) {
}