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