From 016e584f0ad5a071e13d75eb8ad5ddb46b8c54f5 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Tue, 12 Jun 2018 12:50:28 +0200 Subject: use LOG_ABORT not just abort() * abort() has the unfortunate effect that nothing is seen in the log, just an event (which is usually not displayed); so ops people don't see that the program is crashing at all. * LOG_ABORT("message") will log an error with the message (and the file and line) before calling abort(), so it's easy to see what happened. * add or move include and LOG_SETUP lines before LOG_ABORT is used (or included). --- searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp') diff --git a/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp b/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp index c86a1c86dbb..1253cab4a74 100644 --- a/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp +++ b/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp @@ -64,7 +64,7 @@ TEST("Test that sigbus handler can trap synthetic sigbus") sbh.setUnwind(&sjb); kill(getpid(), SIGBUS); LOG(error, "Should never get here"); - abort(); + LOG_ABORT("should not be reached"); } EXPECT_TRUE(sbh.fired()); { @@ -101,7 +101,7 @@ TEST("Test that sigbus handler can trap normal sigbus") sbh.setUnwind(&sjb); r = *p; LOG(error, "Should never get here"); - abort(); + LOG_ABORT("should not be reached"); } EXPECT_TRUE(sbh.fired()); EXPECT_TRUE(r == '\0'); -- cgit v1.2.3