diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-20 21:40:23 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2018-01-10 09:56:23 +0100 |
commit | ebc215414e8ae36449f956f57e85843ee527e61a (patch) | |
tree | c8811fa668d7e8b924f2b7e98af7307f56b79fd0 /searchlib/src/tests | |
parent | 45c8e269822dd3522f3f01146d38d6afc6b8b07b (diff) |
Normal functionality regained.
Diffstat (limited to 'searchlib/src/tests')
-rw-r--r-- | searchlib/src/tests/transactionlog/translogclient_test.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/searchlib/src/tests/transactionlog/translogclient_test.cpp b/searchlib/src/tests/transactionlog/translogclient_test.cpp index b61245c8137..b389c1a8da5 100644 --- a/searchlib/src/tests/transactionlog/translogclient_test.cpp +++ b/searchlib/src/tests/transactionlog/translogclient_test.cpp @@ -316,15 +316,12 @@ bool Test::fillDomainTest(TransLogClient::Session * s1, const vespalib::string & Packet b(DEFAULT_PACKET_SIZE); b.add(e2); b.add(e3); - b.add(e1); + EXPECT_EXCEPTION(b.add(e1), std::runtime_error, ""); ASSERT_TRUE (s1->commit(vespalib::ConstBufferRef(a.getHandle().c_str(), a.getHandle().size()))); ASSERT_TRUE (s1->commit(vespalib::ConstBufferRef(b.getHandle().c_str(), b.getHandle().size()))); - try { - s1->commit(vespalib::ConstBufferRef(a.getHandle().c_str(), a.getHandle().size())); - ASSERT_TRUE(false); - } catch (const std::exception & e) { - EXPECT_EQUAL(vespalib::string("commit failed with code -2. server says: Exception during commit on " + name + " : Incomming serial number(1) must be bigger than the last one (3)."), e.what()); - } + EXPECT_EXCEPTION(s1->commit(vespalib::ConstBufferRef(a.getHandle().c_str(), a.getHandle().size())), + std::runtime_error, + "commit failed with code -2. server says: Exception during commit on " + name + " : Incomming serial number(1) must be bigger than the last one (3)."); EXPECT_EQUAL(a.size(), 1u); EXPECT_EQUAL(a.range().from(), 1u); EXPECT_EQUAL(a.range().to(), 1u); |