summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2018-06-12 12:50:28 +0200
committerArne Juul <arnej@yahoo-inc.com>2018-06-12 13:51:45 +0200
commit016e584f0ad5a071e13d75eb8ad5ddb46b8c54f5 (patch)
tree869d4e4a4c4b8a9f9ef691b2980009017dece9e6 /searchlib/src/tests
parent22796dddd3dc025018093783328ac87535ffecd9 (diff)
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 <vespa/log/log.h> include and LOG_SETUP lines before LOG_ABORT is used (or included).
Diffstat (limited to 'searchlib/src/tests')
-rw-r--r--searchlib/src/tests/aggregator/attr_test.cpp3
-rw-r--r--searchlib/src/tests/aggregator/perdocexpr.cpp4
-rw-r--r--searchlib/src/tests/attribute/attribute_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp11
-rw-r--r--searchlib/src/tests/attribute/benchmark/attributeupdater.h4
-rw-r--r--searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp3
-rw-r--r--searchlib/src/tests/attribute/postinglist/postinglist.cpp6
-rw-r--r--searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp5
-rw-r--r--searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp5
-rw-r--r--searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp3
-rw-r--r--searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp6
-rw-r--r--searchlib/src/tests/btree/frozenbtree_test.cpp8
-rw-r--r--searchlib/src/tests/btree/iteratespeed.cpp6
-rw-r--r--searchlib/src/tests/diskindex/fusion/fusion_test.cpp3
-rw-r--r--searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp2
-rw-r--r--searchlib/src/tests/features/max_reduce_prod_join_replacer/max_reduce_prod_join_replacer_test.cpp5
-rw-r--r--searchlib/src/tests/grouping/grouping_test.cpp3
-rw-r--r--searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp6
-rw-r--r--searchlib/src/tests/groupingengine/groupingengine_test.cpp3
-rw-r--r--searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp6
-rw-r--r--searchlib/src/tests/predicate/simple_index_test.cpp7
-rw-r--r--searchlib/src/tests/queryeval/queryeval.cpp5
-rw-r--r--searchlib/src/tests/util/bufferwriter/bm.cpp2
-rw-r--r--searchlib/src/tests/util/ioerrorhandler/ioerrorhandler_test.cpp8
-rw-r--r--searchlib/src/tests/util/sigbushandler/sigbushandler_test.cpp4
25 files changed, 75 insertions, 45 deletions
diff --git a/searchlib/src/tests/aggregator/attr_test.cpp b/searchlib/src/tests/aggregator/attr_test.cpp
index f374f117f00..c57f335aceb 100644
--- a/searchlib/src/tests/aggregator/attr_test.cpp
+++ b/searchlib/src/tests/aggregator/attr_test.cpp
@@ -1,6 +1,9 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/log/log.h>
+LOG_SETUP("attr_test");
+
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
#include <vespa/searchlib/attribute/extendableattributes.h>
diff --git a/searchlib/src/tests/aggregator/perdocexpr.cpp b/searchlib/src/tests/aggregator/perdocexpr.cpp
index 8a6e70de09a..9837deb0186 100644
--- a/searchlib/src/tests/aggregator/perdocexpr.cpp
+++ b/searchlib/src/tests/aggregator/perdocexpr.cpp
@@ -1,4 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include <vespa/log/log.h>
+LOG_SETUP("per_doc_expr_test");
+
#include <vespa/searchlib/aggregation/aggregation.h>
#include <vespa/searchlib/aggregation/expressioncountaggregationresult.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp
index 9134711773c..5fcc49fc228 100644
--- a/searchlib/src/tests/attribute/attribute_test.cpp
+++ b/searchlib/src/tests/attribute/attribute_test.cpp
@@ -2111,7 +2111,7 @@ AttributeTest::testCompactLidSpace(const Config &config)
}
break;
default:
- abort();
+ LOG_ABORT("should not be reached");
}
}
diff --git a/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp b/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp
index 5722b7c90ca..0eb2dd2cbc4 100644
--- a/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp
+++ b/searchlib/src/tests/attribute/benchmark/attributebenchmark.cpp
@@ -1,4 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include <vespa/log/log.h>
+LOG_SETUP("attributebenchmark");
+
#include <vespa/searchlib/util/randomgenerator.h>
#include <vespa/searchlib/attribute/attribute.h>
#include <vespa/searchlib/attribute/attributeguard.h>
@@ -8,6 +12,7 @@
#include <vespa/searchlib/attribute/singlestringattribute.h>
#include <vespa/searchlib/attribute/multistringattribute.h>
#include <vespa/searchlib/attribute/attrvector.h>
+#include <vespa/searchlib/attribute/attributevector.hpp>
#include <vespa/fastos/thread.h>
#include <vespa/fastos/app.h>
#include <iostream>
@@ -16,12 +21,6 @@
#include "attributeupdater.h"
#include <sys/resource.h>
-#include <vespa/log/log.h>
-
-LOG_SETUP("attributebenchmark");
-
-#include <vespa/searchlib/attribute/attributevector.hpp>
-
using std::shared_ptr;
typedef std::vector<uint32_t> NumVector;
diff --git a/searchlib/src/tests/attribute/benchmark/attributeupdater.h b/searchlib/src/tests/attribute/benchmark/attributeupdater.h
index 13360e58b2d..1b493dabcc7 100644
--- a/searchlib/src/tests/attribute/benchmark/attributeupdater.h
+++ b/searchlib/src/tests/attribute/benchmark/attributeupdater.h
@@ -25,7 +25,7 @@ public:
if (!rc) {
std::cout << "Assert " << _totalCnt << " failed: \"" << str << "\" ("
<< file << ":" << line << ")" << std::endl;
- abort();
+ LOG_ABORT("should not be reached");
}
return true;
}
@@ -39,7 +39,7 @@ public:
std::cout << aStr << ": " << a << std::endl;
std::cout << bStr << ": " << b << std::endl;
std::cout << "(" << file << ":" << line << ")" << std::endl;
- abort();
+ LOG_ABORT("should not be reached");
}
return true;
}
diff --git a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp
index 7b597930d0c..9df37e36b49 100644
--- a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp
+++ b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp
@@ -1,6 +1,9 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/log/log.h>
+LOG_SETUP("document_weight_iterator_test");
+
#include <vespa/searchlib/attribute/i_document_weight_attribute.h>
#include <vespa/searchlib/attribute/attributevector.h>
#include <vespa/searchlib/attribute/attribute.h>
diff --git a/searchlib/src/tests/attribute/postinglist/postinglist.cpp b/searchlib/src/tests/attribute/postinglist/postinglist.cpp
index fe79db163f8..eb8712b774c 100644
--- a/searchlib/src/tests/attribute/postinglist/postinglist.cpp
+++ b/searchlib/src/tests/attribute/postinglist/postinglist.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("postinglist_test");
+
#include <vespa/searchlib/datastore/datastore.h>
#include <vespa/searchlib/btree/btreenodeallocator.hpp>
#include <vespa/searchlib/btree/btreenode.hpp>
@@ -11,9 +14,6 @@
#include <vespa/vespalib/testkit/testapp.h>
#include <set>
-#include <vespa/log/log.h>
-LOG_SETUP("postinglist_test");
-
namespace search {
using vespalib::GenerationHandler;
diff --git a/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp b/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp
index 9d9aaac9f62..ffdf01ce494 100644
--- a/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp
+++ b/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("postinglistattribute_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/stllike/asciistream.h>
@@ -17,8 +20,6 @@
#include <vespa/searchlib/fef/termfieldmatchdata.h>
#include <vespa/fastos/file.h>
#include <iostream>
-#include <vespa/log/log.h>
-LOG_SETUP("postinglistattribute_test");
using std::shared_ptr;
diff --git a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp
index e5af6931977..cbb8f18f9f8 100644
--- a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp
+++ b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp
@@ -1,6 +1,9 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/log/log.h>
+LOG_SETUP("attribute_searchable_adapter_test");
+
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchcommon/attribute/iattributecontext.h>
#include <vespa/searchlib/attribute/attribute_blueprint_factory.h>
#include <vespa/searchlib/attribute/attributefactory.h>
diff --git a/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp
index 39bbb8fb5ad..c5805447d7f 100644
--- a/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp
+++ b/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp
@@ -1,5 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/log/log.h>
+LOG_SETUP("attribute_weighted_set_blueprint_test");
#include <vespa/searchlib/attribute/attribute_blueprint_factory.h>
#include <vespa/searchlib/attribute/attribute_weighted_set_blueprint.h>
@@ -15,7 +17,6 @@
#include <vespa/searchlib/queryeval/weighted_set_term_search.h>
#include <vespa/searchlib/queryeval/fake_requestcontext.h>
-
#include <vespa/searchlib/attribute/enumstore.hpp>
using namespace search;
diff --git a/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp b/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp
index dc7cf53d188..2b8279c6822 100644
--- a/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp
+++ b/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("attributeblueprint_test");
+
#include <vespa/searchcommon/attribute/iattributecontext.h>
#include <vespa/searchlib/attribute/attribute_blueprint_factory.h>
#include <vespa/searchlib/attribute/attributecontext.h>
@@ -15,9 +18,6 @@
#include <vespa/searchlib/queryeval/fake_requestcontext.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/log/log.h>
-LOG_SETUP("attributeblueprint_test");
-
using search::AttributeGuard;
using search::AttributeVector;
using search::IAttributeManager;
diff --git a/searchlib/src/tests/btree/frozenbtree_test.cpp b/searchlib/src/tests/btree/frozenbtree_test.cpp
index 399c20f53cc..871752b7a0d 100644
--- a/searchlib/src/tests/btree/frozenbtree_test.cpp
+++ b/searchlib/src/tests/btree/frozenbtree_test.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("frozenbtree_test");
+
#define DEBUG_FROZENBTREE
#define LOG_FROZENBTREEXX
#include <vespa/vespalib/testkit/testapp.h>
@@ -10,9 +13,6 @@
#include <vespa/searchlib/btree/btreenodeallocator.hpp>
#include <map>
-#include <vespa/log/log.h>
-LOG_SETUP("frozenbtree_test");
-
using search::btree::BTreeRoot;
using search::btree::BTreeNode;
using search::btree::BTreeInternalNode;
@@ -306,7 +306,7 @@ FrozenBTreeTest::sortRandomValues()
} else if (*i == prevVal)
okcnt++;
else
- abort();
+ LOG_ABORT("should not be reached");
prevVal = *i;
}
EXPECT_TRUE(okcnt == sorted.size());
diff --git a/searchlib/src/tests/btree/iteratespeed.cpp b/searchlib/src/tests/btree/iteratespeed.cpp
index 2f60b06d675..6e6029335e8 100644
--- a/searchlib/src/tests/btree/iteratespeed.cpp
+++ b/searchlib/src/tests/btree/iteratespeed.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("iteratespeed");
+
#include <vespa/searchlib/btree/btreeroot.h>
#include <vespa/searchlib/btree/btreebuilder.h>
#include <vespa/searchlib/btree/btreenodeallocator.h>
@@ -18,9 +21,6 @@
#include <vespa/fastos/app.h>
#include <vespa/fastos/timestamp.h>
-#include <vespa/log/log.h>
-LOG_SETUP("iteratespeed");
-
namespace search {
namespace btree {
diff --git a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp
index 07c399b3092..12c9d52356a 100644
--- a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp
+++ b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("fusion_test");
+
#include <vespa/searchlib/diskindex/fusion.h>
#include <vespa/searchlib/diskindex/indexbuilder.h>
#include <vespa/searchlib/diskindex/zcposoccrandread.h>
diff --git a/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp b/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp
index 400108e91b0..ea0f769cc51 100644
--- a/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp
+++ b/searchlib/src/tests/diskindex/pagedict4/pagedict4_hugeword_cornercase_test.cpp
@@ -129,7 +129,7 @@ PostingListCounts makeCounts(uint32_t wantLen)
}
}
LOG(info, "Could not calculate counts with wanted compressed length");
- abort();
+ LOG_ABORT("should not be reached");
}
using StartOffset = search::bitcompression::PageDict4StartOffset;
diff --git a/searchlib/src/tests/features/max_reduce_prod_join_replacer/max_reduce_prod_join_replacer_test.cpp b/searchlib/src/tests/features/max_reduce_prod_join_replacer/max_reduce_prod_join_replacer_test.cpp
index 1c6c224cc79..c9c8124bb94 100644
--- a/searchlib/src/tests/features/max_reduce_prod_join_replacer/max_reduce_prod_join_replacer_test.cpp
+++ b/searchlib/src/tests/features/max_reduce_prod_join_replacer/max_reduce_prod_join_replacer_test.cpp
@@ -8,6 +8,9 @@
#include <vespa/searchlib/fef/test/indexenvironment.h>
#include <vespa/searchlib/fef/blueprint.h>
+#include <vespa/log/log.h>
+LOG_SETUP("max_reduce_prod_join_replacer_test");
+
using search::features::MaxReduceProdJoinReplacer;
using search::features::rankingexpression::ExpressionReplacer;
using search::features::rankingexpression::FeatureNameExtractor;
@@ -36,7 +39,7 @@ struct MyBlueprint : Blueprint {
return true;
}
FeatureExecutor &createExecutor(const IQueryEnvironment &, vespalib::Stash &) const override {
- abort();
+ LOG_ABORT("should not be reached");
}
};
diff --git a/searchlib/src/tests/grouping/grouping_test.cpp b/searchlib/src/tests/grouping/grouping_test.cpp
index 32174ba7647..a10890fba5e 100644
--- a/searchlib/src/tests/grouping/grouping_test.cpp
+++ b/searchlib/src/tests/grouping/grouping_test.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("grouping_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
diff --git a/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp b/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp
index 37aa9cc3268..f414e298869 100644
--- a/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp
+++ b/searchlib/src/tests/groupingengine/groupingengine_benchmark.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("grouping_benchmark");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
@@ -15,9 +18,6 @@
#include <vespa/vespalib/util/rusage.h>
#include <csignal>
-#include <vespa/log/log.h>
-LOG_SETUP("grouping_benchmark");
-
using namespace vespalib;
using namespace search;
using namespace search::attribute;
diff --git a/searchlib/src/tests/groupingengine/groupingengine_test.cpp b/searchlib/src/tests/groupingengine/groupingengine_test.cpp
index a90adc5e0c9..06daaaca10f 100644
--- a/searchlib/src/tests/groupingengine/groupingengine_test.cpp
+++ b/searchlib/src/tests/groupingengine/groupingengine_test.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("grouping_engine_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/aggregation/aggregation.h>
diff --git a/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp b/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp
index c926d1c2831..8e921712cf6 100644
--- a/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp
+++ b/searchlib/src/tests/memoryindex/dictionary/dictionary_test.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/log/log.h>
+LOG_SETUP("dictionary_test");
+
#include <vespa/searchlib/diskindex/fusion.h>
#include <vespa/searchlib/diskindex/indexbuilder.h>
#include <vespa/searchlib/diskindex/zcposoccrandread.h>
@@ -18,9 +21,6 @@
#include <vespa/searchlib/test/searchiteratorverifier.h>
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/log/log.h>
-LOG_SETUP("dictionary_test");
-
namespace search {
using namespace btree;
diff --git a/searchlib/src/tests/predicate/simple_index_test.cpp b/searchlib/src/tests/predicate/simple_index_test.cpp
index 52cf9c138c7..30cc0b2e4bb 100644
--- a/searchlib/src/tests/predicate/simple_index_test.cpp
+++ b/searchlib/src/tests/predicate/simple_index_test.cpp
@@ -1,12 +1,13 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Unit tests for simple_index.
-#include <vespa/searchlib/predicate/simple_index.hpp>
-#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/searchlib/attribute/predicate_attribute.h>
#include <vespa/log/log.h>
LOG_SETUP("simple_index_test");
+#include <vespa/searchlib/predicate/simple_index.hpp>
+#include <vespa/vespalib/testkit/testapp.h>
+#include <vespa/searchlib/attribute/predicate_attribute.h>
+
using namespace search;
using namespace search::predicate;
using vespalib::GenerationHolder;
diff --git a/searchlib/src/tests/queryeval/queryeval.cpp b/searchlib/src/tests/queryeval/queryeval.cpp
index c6dd6a430cc..1ad0b643799 100644
--- a/searchlib/src/tests/queryeval/queryeval.cpp
+++ b/searchlib/src/tests/queryeval/queryeval.cpp
@@ -1,6 +1,9 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/vespalib/testkit/test_kit.h>
+#include <vespa/log/log.h>
+LOG_SETUP("query_eval_test");
+
+#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/test/initrange.h>
#include <vespa/searchlib/common/bitvectoriterator.h>
#include <vespa/searchlib/queryeval/andnotsearch.h>
diff --git a/searchlib/src/tests/util/bufferwriter/bm.cpp b/searchlib/src/tests/util/bufferwriter/bm.cpp
index e5ff0f49973..3370860d2b6 100644
--- a/searchlib/src/tests/util/bufferwriter/bm.cpp
+++ b/searchlib/src/tests/util/bufferwriter/bm.cpp
@@ -46,7 +46,7 @@ callWork(size_t size, WorkFuncDispatch dispatch)
workFunctor2(foo, writer);
break;
default:
- abort();
+ LOG_ABORT("should not be reached");
}
double after = getTime();
double delta = (after - before);
diff --git a/searchlib/src/tests/util/ioerrorhandler/ioerrorhandler_test.cpp b/searchlib/src/tests/util/ioerrorhandler/ioerrorhandler_test.cpp
index f6055376907..aaa2a138353 100644
--- a/searchlib/src/tests/util/ioerrorhandler/ioerrorhandler_test.cpp
+++ b/searchlib/src/tests/util/ioerrorhandler/ioerrorhandler_test.cpp
@@ -214,7 +214,7 @@ TEST_F("Test that ioerror handler can process read error", Fixture)
injectreadErrnoTrigger = 1;
f.file->ReadBuf(buf, fileSize);
LOG(error, "Should never get here");
- abort();
+ LOG_ABORT("should not be reached");
} catch (std::runtime_error &e) {
LOG(info, "Caught std::runtime_error exception: %s", e.what());
EXPECT_TRUE(strstr(e.what(), "Input/output error") != nullptr);
@@ -254,7 +254,7 @@ TEST_F("Test that ioerror handler can process pread error", Fixture)
injectpreadErrnoTrigger = 1;
f.file->ReadBuf(buf, fileSize, 0);
LOG(error, "Should never get here");
- abort();
+ LOG_ABORT("should not be reached");
} catch (std::runtime_error &e) {
LOG(info, "Caught std::runtime_error exception: %s", e.what());
EXPECT_TRUE(strstr(e.what(), "Input/output error") != nullptr);
@@ -288,7 +288,7 @@ TEST_F("Test that ioerror handler can process write error", Fixture)
injectwriteErrnoTrigger = 1;
f.writeTestString();
LOG(error, "Should never get here");
- abort();
+ LOG_ABORT("should not be reached");
} catch (std::runtime_error &e) {
LOG(info, "Caught std::runtime_error exception: %s", e.what());
EXPECT_TRUE(strstr(e.what(), "Input/output error") != nullptr);
@@ -323,7 +323,7 @@ TEST_F("Test that ioerror handler can process pwrite error", Fixture)
injectpwriteErrnoTrigger = 1;
f.writeTestString();
LOG(error, "Should never get here");
- abort();
+ LOG_ABORT("should not be reached");
} catch (std::runtime_error &e) {
LOG(info, "Caught std::runtime_error exception: %s", e.what());
EXPECT_TRUE(strstr(e.what(), "Input/output error") != nullptr);
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');