summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-04-30 14:03:19 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-05-01 12:50:02 +1000
commit1f96787cd90666c34306a8884011e01ebca23d2e (patch)
tree17a6e23dbe486bdbdb17d3f6411a57c228ad18ee
parente51b9e36422fd04da82a35b6d29c3a165d6d6849 (diff)
server/misc: fix the double-segfault test
The server calls exit(1) on SIGSEGV, abort() is only called if we double-segfault (i.e. FatalError is called from within FatalError). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--tests/server/misc.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/server/misc.cpp b/tests/server/misc.cpp
index 346d18a..312f99d 100644
--- a/tests/server/misc.cpp
+++ b/tests/server/misc.cpp
@@ -92,7 +92,7 @@ TEST_F(EventQueueTest, mieqOverflow)
TEST(MiscServerTest, DoubleSegfault)
{
XORG_TESTCASE("TESTCASE: SIGSEGV the server. The server must catch the "
- "signal, clean up and then call abort().\n");
+ "signal, clean up and then call exit(1).\n");
XITServer server;
server.Start();
@@ -112,10 +112,9 @@ TEST(MiscServerTest, DoubleSegfault)
if (waitpid(server.Pid(), &status, 0) == -1)
break;
- ASSERT_TRUE(WIFSIGNALED(status));
- int termsig = WTERMSIG(status);
- ASSERT_EQ(termsig, SIGABRT)
- << "Expected SIGABRT, got " << termsig << " (" << strsignal(termsig) << ")";
+ /* A SIGSEGV triggers FatalError and then exit(1) */
+ ASSERT_FALSE(WIFSIGNALED(status));
+ ASSERT_EQ(WEXITSTATUS(status), 1);
std::ifstream logfile(server.GetLogFilePath().c_str());
std::string line;