2015-09-01 19:09:11 +02:00
|
|
|
#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);
|
|
|
|
}
|
|
|
|
|
2016-09-05 21:32:57 +02:00
|
|
|
void do_exit(void)
|
|
|
|
{
|
2015-09-01 19:09:11 +02:00
|
|
|
exit(127);
|
|
|
|
}
|
|
|
|
|
|
|
|
Test(exit_with_fixtures, init_exits, .init = do_exit) {
|
|
|
|
}
|
|
|
|
|
|
|
|
Test(exit_with_fixtures, fini_exits, .fini = do_exit) {
|
|
|
|
}
|