diff options
-rw-r--r-- | searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp | 12 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/test/statestring.cpp | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp b/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp index 658ad17544a..e687eff3ca7 100644 --- a/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp +++ b/searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp @@ -66,16 +66,22 @@ TEST("Test that sigbus handler can trap synthetic sigbus") LOG_ABORT("Should never get here"); } EXPECT_TRUE(sbh.fired()); +#ifdef __APPLE__ + vespalib::string exp_state = "state=down ts=0.0 operation=sigbus errno=0 code=2 addr=0x0000000000000000\n"; +#else + vespalib::string exp_state = "state=down ts=0.0 operation=sigbus errno=0 code=0\n"; +#endif { vespalib::string act = readState(sf); normalizeTimestamp(act); - EXPECT_EQUAL("state=down ts=0.0 operation=sigbus errno=0 code=0\n", - act); + normalizeAddr(act, nullptr); + EXPECT_EQUAL(exp_state, act); } { - strvec exp({"state=down ts=0.0 operation=sigbus errno=0 code=0\n" }); + strvec exp({exp_state}); std::vector<vespalib::string> act(readHistory("state.history")); normalizeTimestamps(act); + normalizeAddrs(act, nullptr); TEST_DO(assertHistory(exp, act)); } } diff --git a/searchlib/src/vespa/searchlib/test/statestring.cpp b/searchlib/src/vespa/searchlib/test/statestring.cpp index 33e47b3d961..480e6bbc275 100644 --- a/searchlib/src/vespa/searchlib/test/statestring.cpp +++ b/searchlib/src/vespa/searchlib/test/statestring.cpp @@ -7,7 +7,7 @@ namespace search::test::statestring { bool testStartPos(vespalib::string &s, size_t pos) { - return (pos < s.size() && (pos == 0 || s[pos - 1] == ' ')); + return ((pos >= s.size()) || (pos == 0) || (s[pos - 1] == ' ')); } size_t |