From: Michal 'vorner' Vaner Date: Thu, 11 Jul 2013 07:10:30 +0000 (+0200) Subject: [2861] Test that we abort on unexpected errors X-Git-Tag: bind10-1.2.0beta1-release~343^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=009e306698d3c8018fc2a83aa2c9cb6bd787a875;p=thirdparty%2Fkea.git [2861] Test that we abort on unexpected errors --- diff --git a/src/bin/auth/tests/datasrc_clients_builder_unittest.cc b/src/bin/auth/tests/datasrc_clients_builder_unittest.cc index 53a1f2cd14..f9c2cf2e81 100644 --- a/src/bin/auth/tests/datasrc_clients_builder_unittest.cc +++ b/src/bin/auth/tests/datasrc_clients_builder_unittest.cc @@ -131,6 +131,16 @@ TEST_F(DataSrcClientsBuilderTest, commandFinished) { EXPECT_EQ(1, result); } +// Test that low-level errors with the synchronization socket +// (an unexpected condition) is detected and program aborted. +TEST_F(DataSrcClientsBuilderTest, finishedCrash) { + command_queue.push_back(Command(SHUTDOWN, ConstElementPtr(), + emptyCallsback)); + // Break the socket + close(write_end); + EXPECT_DEATH_IF_SUPPORTED({builder.run();}, ""); +} + TEST_F(DataSrcClientsBuilderTest, runMultiCommands) { // Two NOOP commands followed by SHUTDOWN. We should see two doNoop() // calls.