blob: 93d7c58adb2e4479ee7cf839377d86a84cff5cee [file] [log] [blame]
Brian Silvermanf5f8d8e2015-12-06 18:39:12 -05001#include "aos/testing/prevent_exit.h"
2
3#include <stdlib.h>
4#include <unistd.h>
5
6#include "aos/common/logging/logging.h"
7
8namespace aos {
9namespace testing {
10namespace {
11
12void TerminateExitHandler() {
13 _exit(EXIT_SUCCESS);
14}
15
16} // namespace
17
18void PreventExit() {
19 CHECK_EQ(atexit(TerminateExitHandler), 0);
20}
21
22} // namespace testing
23} // namespace aos