blob: 3190698605e8b26479225119b01f7edbfae0a4d8 [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
John Park33858a32018-09-28 23:05:48 -07006#include "aos/logging/logging.h"
Brian Silvermanf5f8d8e2015-12-06 18:39:12 -05007
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