[go: up one dir, main page]

File: exception.cc

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 (28 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (2)
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
26
27
28
#include <criterion/criterion.h>
#include <stdexcept>

void raise_std(void)
{
    throw std::invalid_argument("Some exception message");
}

void raise_any(void)
{
    throw 1;
}

Test(exception, raise_std) {
    raise_std();
}
Test(exception, raise_any) {
    raise_any();
}

Test(exception, raise_std_init, .init = raise_std) {
}
Test(exception, raise_any_init, .init = raise_any) {
}
Test(exception, raise_std_fini, .fini = raise_std) {
}
Test(exception, raise_any_fini, .fini = raise_any) {
}