aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-05-03 16:58:18 +0200
committerGitHub <noreply@github.com>2017-05-03 16:58:18 +0200
commit56cda12279b911a004a2e8c41ab274665a7a8b5f (patch)
treef1bfc1a650ff84310a6375e3ccf02660223e8ee8
parent790c0537be1444dec6e1f4c6cdb597bedb707e91 (diff)
Revert "Revert "Fix warnings hidden earlier due to including application headers as s…""
-rw-r--r--searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp4
-rw-r--r--searchlib/src/tests/attribute/imported_attribute_vector/imported_attribute_vector_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp4
-rw-r--r--searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp14
-rw-r--r--searchlib/src/tests/attribute/postinglist/postinglist.cpp45
-rw-r--r--searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/searchcontext/searchcontext.cpp3
-rw-r--r--searchlib/src/tests/common/rcuvector/rcuvector_test.cpp8
-rw-r--r--searchlib/src/tests/datastore/array_store/array_store_test.cpp12
-rw-r--r--searchlib/src/tests/datastore/array_store_config/array_store_config_test.cpp8
-rw-r--r--searchlib/src/tests/diskindex/diskindex/diskindex_test.cpp5
-rw-r--r--searchlib/src/tests/docstore/document_store/visitcache_test.cpp20
-rw-r--r--searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp8
-rw-r--r--searchlib/src/tests/features/beta/beta_features.cpp10
-rw-r--r--searchlib/src/tests/features/featurebenchmark.cpp20
-rw-r--r--searchlib/src/tests/features/prod_features.h2
-rw-r--r--searchlib/src/tests/features/prod_features_fieldmatch.cpp12
-rw-r--r--searchlib/src/tests/fef/properties/properties_test.cpp5
-rw-r--r--searchlib/src/tests/fef/resolver/resolver_test.cpp9
-rw-r--r--searchlib/src/tests/fef/table/table_test.cpp14
-rw-r--r--searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp4
-rw-r--r--searchlib/src/tests/memoryindex/btree/frozenbtree_test.cpp112
-rw-r--r--searchlib/src/tests/nativerank/nativerank.cpp9
-rw-r--r--searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp4
-rw-r--r--searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp7
-rw-r--r--searchlib/src/tests/ranksetup/ranksetup_test.cpp7
26 files changed, 153 insertions, 197 deletions
diff --git a/searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp b/searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp
index 03b5931c6b9..525643e377c 100644
--- a/searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp
+++ b/searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp
@@ -177,7 +177,7 @@ TEST_F("Test that no compaction of int8 array attribute increases address space
AddressSpace afterSpace = f.getMultiValueAddressSpaceUsage("after");
// 100 * 1000 dead clusters due to new values for docids
// 1 reserved cluster accounted as dead
- EXPECT_EQUAL(100001, afterSpace.dead());
+ EXPECT_EQUAL(100001u, afterSpace.dead());
}
TEST_F("Test that compaction of int8 array attribute limits address space usage", Fixture(compactAddressSpaceAttributeConfig(true)))
@@ -188,7 +188,7 @@ TEST_F("Test that compaction of int8 array attribute limits address space usage"
f.hammer(range2, 101);
AddressSpace afterSpace = f.getMultiValueAddressSpaceUsage("after");
// DEAD_CLUSTERS_SLACK in multi value mapping is is 64k
- EXPECT_GREATER(65536, afterSpace.dead());
+ EXPECT_GREATER(65536u, afterSpace.dead());
}
TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchlib/src/tests/attribute/imported_attribute_vector/imported_attribute_vector_test.cpp b/searchlib/src/tests/attribute/imported_attribute_vector/imported_attribute_vector_test.cpp
index b46875cf3e6..3621537c8fd 100644
--- a/searchlib/src/tests/attribute/imported_attribute_vector/imported_attribute_vector_test.cpp
+++ b/searchlib/src/tests/attribute/imported_attribute_vector/imported_attribute_vector_test.cpp
@@ -23,7 +23,7 @@ TEST_F("getName() is equal to name given during construction", Fixture) {
TEST_F("getNumDocs() returns number of documents in reference attribute vector", Fixture) {
add_n_docs_with_undefined_values(*f.reference_attr, 42);
- EXPECT_EQUAL(42, f.imported_attr->getNumDocs());
+ EXPECT_EQUAL(42u, f.imported_attr->getNumDocs());
}
TEST_F("hasEnum() is false for non-enum target attribute vector", Fixture) {
diff --git a/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp b/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
index af57eec46b1..f50767d22b3 100644
--- a/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
+++ b/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp
@@ -1,9 +1,9 @@
// Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/searchcommon/attribute/search_context_params.h>
#include <vespa/searchlib/test/imported_attribute_fixture.h>
#include <vespa/searchlib/attribute/imported_search_context.h>
#include <vespa/searchlib/fef/termfieldmatchdata.h>
+#include <vespa/searchcommon/attribute/search_context_params.h>
namespace search {
namespace attribute {
@@ -65,7 +65,7 @@ TEST_F("approximateHits() returns document count of reference attribute", Fixtur
add_n_docs_with_undefined_values(*f.reference_attr, 101);
auto ctx = f.create_context(word_term("foo"));
- EXPECT_EQUAL(101, ctx->approximateHits());
+ EXPECT_EQUAL(101u, ctx->approximateHits());
}
TEST_F("attributeName() returns imported attribute name", Fixture) {
diff --git a/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp b/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp
index 20590a11da0..e41045c2aae 100644
--- a/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp
+++ b/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp
@@ -1,16 +1,17 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("multivaluemapping_test");
+
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/attribute/multi_value_mapping.h>
#include <vespa/searchlib/attribute/multi_value_mapping.hpp>
#include <vespa/searchlib/attribute/not_implemented_attribute.h>
+#include <vespa/searchlib/util/rand48.h>
#include <vespa/vespalib/util/generationhandler.h>
#include <vespa/vespalib/test/insertion_operators.h>
-#include <vespa/searchlib/util/rand48.h>
#include <vespa/vespalib/stllike/hash_set.h>
+#include <vespa/log/log.h>
+LOG_SETUP("multivaluemapping_test");
+
using search::datastore::ArrayStoreConfig;
template <typename EntryT>
@@ -44,8 +45,7 @@ public:
MyAttribute(MvMapping &mvMapping)
: NotImplementedAttribute("test", AttributeVector::Config()),
_mvMapping(mvMapping)
- {
- }
+ {}
virtual bool addDoc(DocId &doc) override {
_mvMapping.addDoc(doc);
incNumDocs();
@@ -237,7 +237,7 @@ TEST_F("Test that old value is not overwritten while held", Fixture<int>(3, 32,
TEST_F("Test that addDoc works", Fixture<int>(3))
{
- EXPECT_EQUAL(0, f.size());
+ EXPECT_EQUAL(0u, f.size());
f.addDocs(10);
EXPECT_EQUAL(10u, f.size());
}
diff --git a/searchlib/src/tests/attribute/postinglist/postinglist.cpp b/searchlib/src/tests/attribute/postinglist/postinglist.cpp
index 271b062ebcd..35e702dcaf1 100644
--- a/searchlib/src/tests/attribute/postinglist/postinglist.cpp
+++ b/searchlib/src/tests/attribute/postinglist/postinglist.cpp
@@ -1,15 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("postinglist_test");
-#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/searchlib/util/rand48.h>
-#include <algorithm>
-#include <limits>
-#include <map>
-#include <set>
-
#include <vespa/searchlib/datastore/datastore.h>
#include <vespa/searchlib/btree/btreenodeallocator.hpp>
#include <vespa/searchlib/btree/btreenode.hpp>
@@ -17,6 +7,12 @@ LOG_SETUP("postinglist_test");
#include <vespa/searchlib/btree/btreeiterator.hpp>
#include <vespa/searchlib/btree/btreeroot.hpp>
#include <vespa/searchlib/btree/btreestore.hpp>
+#include <vespa/searchlib/util/rand48.h>
+#include <vespa/vespalib/testkit/testapp.h>
+#include <set>
+
+#include <vespa/log/log.h>
+LOG_SETUP("postinglist_test");
namespace search {
@@ -215,26 +211,27 @@ private:
return frozen ? "frozen" : "thawed";
}
public:
- AttributePostingListTest(void)
- : vespalib::TestApp(),
- _randomValues(),
- _handler(),
- _intKeyStore(NULL),
- _intNodeAlloc(NULL),
- _intTree(NULL),
- _intPostings(NULL),
- _stlTree(NULL),
- _randomGenerator()
- {
- }
+ AttributePostingListTest();
+ ~AttributePostingListTest();
int Main(void) override;
};
-
+AttributePostingListTest::AttributePostingListTest()
+ : vespalib::TestApp(),
+ _randomValues(),
+ _handler(),
+ _intKeyStore(NULL),
+ _intNodeAlloc(NULL),
+ _intTree(NULL),
+ _intPostings(NULL),
+ _stlTree(NULL),
+ _randomGenerator()
+{}
+AttributePostingListTest::~AttributePostingListTest() {}
void
-AttributePostingListTest::allocTree(void)
+AttributePostingListTest::allocTree()
{
_intKeyStore = new IntKeyStore;
_intNodeAlloc = new IntEnumNodeAllocator();
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 8e624c2556a..255d22d1636 100644
--- a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp
+++ b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp
@@ -227,7 +227,7 @@ bool search(const Node &node, IAttributeManager &attribute_manager,
} else {
if (empty) {
EXPECT_TRUE(result.est_empty);
- EXPECT_EQUAL(0, result.est_hits);
+ EXPECT_EQUAL(0u, result.est_hits);
} else {
EXPECT_TRUE(!result.est_empty);
EXPECT_EQUAL(num_docs, result.est_hits);
diff --git a/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp b/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp
index 618adb006d6..ddd2bd13707 100644
--- a/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp
+++ b/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp
@@ -280,6 +280,7 @@ private:
public:
SearchContextTest();
+ ~SearchContextTest();
int Main() override;
};
@@ -1893,6 +1894,8 @@ SearchContextTest::SearchContextTest() :
initStringConfig();
}
+SearchContextTest::~SearchContextTest() {}
+
int
SearchContextTest::Main()
{
diff --git a/searchlib/src/tests/common/rcuvector/rcuvector_test.cpp b/searchlib/src/tests/common/rcuvector/rcuvector_test.cpp
index cd6ae2c2567..9361b35ada9 100644
--- a/searchlib/src/tests/common/rcuvector/rcuvector_test.cpp
+++ b/searchlib/src/tests/common/rcuvector/rcuvector_test.cpp
@@ -1,7 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("rcuvector_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/common/rcuvector.h>
@@ -278,8 +276,8 @@ TEST_F("require that shrink() does not increase allocated memory", ShrinkFixture
TEST_F("require that shrink() can shrink mmap allocation", ShrinkFixture)
{
f.vec.shrink(2048);
- EXPECT_EQUAL(2048, f.vec.size());
- EXPECT_EQUAL(3072, f.vec.capacity());
+ EXPECT_EQUAL(2048u, f.vec.size());
+ EXPECT_EQUAL(3072u, f.vec.capacity());
TEST_DO(f.assertOldEqualNewBuffer());
TEST_DO(f.assertEmptyHoldList());
}
diff --git a/searchlib/src/tests/datastore/array_store/array_store_test.cpp b/searchlib/src/tests/datastore/array_store/array_store_test.cpp
index aace9f6988a..966a3243011 100644
--- a/searchlib/src/tests/datastore/array_store/array_store_test.cpp
+++ b/searchlib/src/tests/datastore/array_store/array_store_test.cpp
@@ -1,12 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("array_store_test");
+
+#include <vespa/searchlib/datastore/array_store.hpp>
+#include <vespa/searchlib/test/datastore/memstats.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/test/insertion_operators.h>
#include <vespa/vespalib/util/traits.h>
-#include <vespa/searchlib/datastore/array_store.hpp>
-#include <vespa/searchlib/test/datastore/memstats.h>
#include <vector>
using namespace search::datastore;
@@ -316,8 +314,8 @@ TEST_F("require that address space usage is ratio between used clusters and numb
f.add({2,2});
f.add({4,4,4});
// 1 cluster is reserved (buffer 0, offset 0).
- EXPECT_EQUAL(3, f.store.addressSpaceUsage().used());
- EXPECT_EQUAL(1, f.store.addressSpaceUsage().dead());
+ EXPECT_EQUAL(3u, f.store.addressSpaceUsage().used());
+ EXPECT_EQUAL(1u, f.store.addressSpaceUsage().dead());
size_t fourgig = (1ull << 32);
/*
* Expected limit is sum of allocated clusters for active buffers and
diff --git a/searchlib/src/tests/datastore/array_store_config/array_store_config_test.cpp b/searchlib/src/tests/datastore/array_store_config/array_store_config_test.cpp
index bc7a446b3b4..e5e22c58cae 100644
--- a/searchlib/src/tests/datastore/array_store_config/array_store_config_test.cpp
+++ b/searchlib/src/tests/datastore/array_store_config/array_store_config_test.cpp
@@ -1,7 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("array_store_config_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/datastore/entryref.h>
#include <vespa/searchlib/datastore/array_store_config.h>
@@ -41,7 +39,7 @@ constexpr size_t MB = KB * KB;
TEST_F("require that default allocation spec is given for all array sizes", Fixture(3, AllocSpec(4, 32, 8)))
{
- EXPECT_EQUAL(3, f.cfg.maxSmallArraySize());
+ EXPECT_EQUAL(3u, f.cfg.maxSmallArraySize());
TEST_DO(f.assertSpec(0, AllocSpec(4, 32, 8)));
TEST_DO(f.assertSpec(1, AllocSpec(4, 32, 8)));
TEST_DO(f.assertSpec(2, AllocSpec(4, 32, 8)));
@@ -53,7 +51,7 @@ TEST_F("require that we can generate config optimized for a given huge page", Fi
4 * KB,
8 * KB))
{
- EXPECT_EQUAL(1024, f.cfg.maxSmallArraySize());
+ EXPECT_EQUAL(1024u, f.cfg.maxSmallArraySize());
TEST_DO(f.assertSpec(0, 8 * KB)); // large arrays
TEST_DO(f.assertSpec(1, 256 * KB));
TEST_DO(f.assertSpec(2, 256 * KB));
diff --git a/searchlib/src/tests/diskindex/diskindex/diskindex_test.cpp b/searchlib/src/tests/diskindex/diskindex/diskindex_test.cpp
index adabe0e2679..2eb0fda6fbe 100644
--- a/searchlib/src/tests/diskindex/diskindex/diskindex_test.cpp
+++ b/searchlib/src/tests/diskindex/diskindex/diskindex_test.cpp
@@ -13,10 +13,10 @@
#include <vespa/searchlib/queryeval/emptysearch.h>
#include <vespa/searchlib/queryeval/fake_requestcontext.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
+#include <vespa/searchlib/test/fakedata/fpfactory.h>
#include <vespa/vespalib/io/fileutil.h>
#include <iostream>
#include <set>
-#include <vespa/searchlib/test/fakedata/fpfactory.h>
using search::BitVectorIterator;
using namespace search::fef;
@@ -63,6 +63,7 @@ private:
void requireThatSearchIteratorsConforms();
public:
Test();
+ ~Test();
int Main() override;
};
@@ -282,6 +283,8 @@ Test::Test() :
{
}
+Test::~Test() {}
+
int
Test::Main()
{
diff --git a/searchlib/src/tests/docstore/document_store/visitcache_test.cpp b/searchlib/src/tests/docstore/document_store/visitcache_test.cpp
index 3fac4cbb954..cb41099da28 100644
--- a/searchlib/src/tests/docstore/document_store/visitcache_test.cpp
+++ b/searchlib/src/tests/docstore/document_store/visitcache_test.cpp
@@ -32,23 +32,23 @@ TEST("require that KeySet compares well") {
EXPECT_FALSE(KeySet({1,3,5}) < KeySet({1,2}));
EXPECT_TRUE(KeySet({1,2}) < KeySet({1,3,5}));
EXPECT_FALSE(KeySet({1,4}) < KeySet({1,3,5}));
- EXPECT_EQUAL(1, a.getKeys()[0]);
- EXPECT_EQUAL(2, a.getKeys()[1]);
- EXPECT_EQUAL(3, a.getKeys()[2]);
- EXPECT_EQUAL(4, a.getKeys()[3]);
- EXPECT_EQUAL(6, a.getKeys()[4]);
- EXPECT_EQUAL(9, a.getKeys()[5]);
+ EXPECT_EQUAL(1u, a.getKeys()[0]);
+ EXPECT_EQUAL(2u, a.getKeys()[1]);
+ EXPECT_EQUAL(3u, a.getKeys()[2]);
+ EXPECT_EQUAL(4u, a.getKeys()[3]);
+ EXPECT_EQUAL(6u, a.getKeys()[4]);
+ EXPECT_EQUAL(9u, a.getKeys()[5]);
}
namespace {
void verifyAB(const BlobSet & a) {
- EXPECT_EQUAL(0, a.get(8).size());
- EXPECT_EQUAL(6, a.get(7).size());
- EXPECT_EQUAL(5, a.get(9).size());
+ EXPECT_EQUAL(0u, a.get(8).size());
+ EXPECT_EQUAL(6u, a.get(7).size());
+ EXPECT_EQUAL(5u, a.get(9).size());
EXPECT_EQUAL(0, strncmp(a.get(7).c_str(), "aaaaaa", 6));
EXPECT_EQUAL(0, strncmp(a.get(9).c_str(), "bbbbb", 5));
- EXPECT_EQUAL(11, a.getBuffer().size());
+ EXPECT_EQUAL(11u, a.getBuffer().size());
EXPECT_EQUAL(0, strncmp(a.getBuffer().c_str(), "aaaaaabbbbb", 11));
}
diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
index f53423a4981..c1cd330df87 100644
--- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
+++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
@@ -138,7 +138,7 @@ TEST("testThatLidInfoOrdersFileChunkSize") {
}
TEST("test that DirectIOPadding works accordng to spec") {
- constexpr size_t FILE_SIZE = 4096*3;
+ constexpr ssize_t FILE_SIZE = 4096*3;
FastOS_File file("directio.test");
file.EnableDirectIO();
EXPECT_TRUE(file.OpenReadWrite());
@@ -855,7 +855,7 @@ TEST("test that StoreByBucket gives bucket by bucket and ordered within") {
TEST("test that LidInfo has 8 bytes size and that it can represent the numbers correctly.")
{
- EXPECT_EQUAL(8, sizeof(LidInfo));
+ EXPECT_EQUAL(8u, sizeof(LidInfo));
LidInfo a(0,0,0);
EXPECT_EQUAL(0u, a.getFileId());
EXPECT_EQUAL(0u, a.getChunkId());
@@ -887,8 +887,8 @@ TEST("test that LidInfo has 8 bytes size and that it can represent the numbers c
EXPECT_TRUE(a.valid());
EXPECT_FALSE(a.empty());
a = LidInfo(0xffff,0x3fffff,0xffffff80u);
- EXPECT_EQUAL(0xffff, a.getFileId());
- EXPECT_EQUAL(0x3fffff, a.getChunkId());
+ EXPECT_EQUAL(0xffffu, a.getFileId());
+ EXPECT_EQUAL(0x3fffffu, a.getChunkId());
EXPECT_EQUAL(0xffffff80u, a.size());
EXPECT_TRUE(a.valid());
EXPECT_FALSE(a.empty());
diff --git a/searchlib/src/tests/features/beta/beta_features.cpp b/searchlib/src/tests/features/beta/beta_features.cpp
index fcb769faef6..420baf29bc1 100644
--- a/searchlib/src/tests/features/beta/beta_features.cpp
+++ b/searchlib/src/tests/features/beta/beta_features.cpp
@@ -1,7 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("beta_features_test");
#include <vespa/searchlib/attribute/attributeguard.h>
#include <vespa/searchlib/attribute/attributemanager.h>
@@ -35,8 +32,8 @@ LOG_SETUP("beta_features_test");
#include <vespa/searchlib/fef/indexproperties.h>
#include <vespa/searchlib/fef/test/plugin/setup.h>
#include <vespa/searchlib/util/rand48.h>
-#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/searchlib/fef/test/ftlib.h>
+#include <vespa/vespalib/util/stringfmt.h>
using namespace search::features;
using namespace search::fef;
@@ -64,6 +61,8 @@ public:
//---------------------------------------------------------------------------------------------------------------------
class Test : public FtTestApp {
public:
+ Test();
+ ~Test();
int Main() override;
void testJaroWinklerDistance();
void testProximity();
@@ -84,6 +83,9 @@ private:
TEST_APPHOOK(Test);
+Test::Test() {}
+Test::~Test() {}
+
int
Test::Main()
{
diff --git a/searchlib/src/tests/features/featurebenchmark.cpp b/searchlib/src/tests/features/featurebenchmark.cpp
index 40345b1c023..7e43b0e46e0 100644
--- a/searchlib/src/tests/features/featurebenchmark.cpp
+++ b/searchlib/src/tests/features/featurebenchmark.cpp
@@ -1,12 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("featurebenchmark");
-
-#include <fstream>
-#include <iomanip>
-#include <iostream>
-#include <string>
#include <vespa/searchlib/attribute/attributefactory.h>
#include <vespa/searchlib/attribute/attributevector.h>
@@ -21,6 +13,11 @@ LOG_SETUP("featurebenchmark");
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/searchlib/fef/test/ftlib.h>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <string>
+
using namespace search::features;
using namespace search::fef;
using namespace search::fef::test;
@@ -131,13 +128,16 @@ private:
void runNativeProximity(Config & cfg);
public:
- Benchmark() : _factory(), _timer(), _sample() {}
+ Benchmark();
+ ~Benchmark();
int Main() override;
};
TEST_APPHOOK(Benchmark);
+Benchmark::Benchmark() : _factory(), _timer(), _sample() {}
+Benchmark::~Benchmark() {}
bool
Benchmark::Config::isKnown(const vespalib::string & key) const
@@ -167,7 +167,7 @@ Benchmark::Config::init(const vespalib::string & fileName)
std::getline(is, line);
if (!line.empty()) {
std::vector<vespalib::string> values = FtUtil::tokenize(line, "=");
- LOG_ASSERT(values.size() == 2);
+ assert(values.size() == 2);
add(values[0], values[1]);
}
}
diff --git a/searchlib/src/tests/features/prod_features.h b/searchlib/src/tests/features/prod_features.h
index 5722a61a1f5..cc839703c98 100644
--- a/searchlib/src/tests/features/prod_features.h
+++ b/searchlib/src/tests/features/prod_features.h
@@ -9,6 +9,8 @@
class Test : public FtTestApp
{
public:
+ Test();
+ ~Test();
int Main() override;
void testFramework();
void testFtLib();
diff --git a/searchlib/src/tests/features/prod_features_fieldmatch.cpp b/searchlib/src/tests/features/prod_features_fieldmatch.cpp
index f2fc7016751..089002b2b78 100644
--- a/searchlib/src/tests/features/prod_features_fieldmatch.cpp
+++ b/searchlib/src/tests/features/prod_features_fieldmatch.cpp
@@ -1,20 +1,20 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".prod_features_fieldmatch");
-
-#include <vespa/searchlib/fef/test/ftlib.h>
#include "prod_features.h"
-
#include <vespa/searchlib/features/fieldmatchfeature.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".prod_features_fieldmatch");
+
using namespace search::features;
using namespace search::fef;
using namespace search::fef::test;
using search::AttributeVector;
using CollectionType = FieldInfo::CollectionType;
+Test::Test() {}
+Test::~Test() {}
+
void
Test::testFieldMatch()
{
diff --git a/searchlib/src/tests/fef/properties/properties_test.cpp b/searchlib/src/tests/fef/properties/properties_test.cpp
index b63cf82a54e..c7400d5815b 100644
--- a/searchlib/src/tests/fef/properties/properties_test.cpp
+++ b/searchlib/src/tests/fef/properties/properties_test.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/fef/indexproperties.h>
#include <vespa/searchlib/fef/properties.h>
@@ -278,9 +277,9 @@ TEST("test stuff") {
{ // vespa.matching.minhitsperthread
EXPECT_EQUAL(matching::MinHitsPerThread::NAME, vespalib::string("vespa.matching.minhitsperthread"));
- EXPECT_EQUAL(matching::MinHitsPerThread::DEFAULT_VALUE, 0);
+ EXPECT_EQUAL(matching::MinHitsPerThread::DEFAULT_VALUE, 0u);
Properties p;
- EXPECT_EQUAL(matching::MinHitsPerThread::lookup(p), 0);
+ EXPECT_EQUAL(matching::MinHitsPerThread::lookup(p), 0u);
p.add("vespa.matching.minhitsperthread", "50");
EXPECT_EQUAL(matching::MinHitsPerThread::lookup(p), 50u);
}
diff --git a/searchlib/src/tests/fef/resolver/resolver_test.cpp b/searchlib/src/tests/fef/resolver/resolver_test.cpp
index e7805f123ef..37a46861931 100644
--- a/searchlib/src/tests/fef/resolver/resolver_test.cpp
+++ b/searchlib/src/tests/fef/resolver/resolver_test.cpp
@@ -1,12 +1,13 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("resolver_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/fef/fef.h>
#include <vespa/searchlib/fef/test/indexenvironment.h>
#include <vespa/searchlib/features/valuefeature.h>
+#include <vespa/log/log.h>
+LOG_SETUP("resolver_test");
+
namespace search {
namespace fef {
@@ -59,6 +60,7 @@ private:
void requireThatWeGetUniqueBlueprints();
public:
Test();
+ ~Test();
int Main() override;
};
@@ -68,6 +70,7 @@ Test::Test() :
_factory.addPrototype(Blueprint::SP(new BaseBlueprint()));
_factory.addPrototype(Blueprint::SP(new CombineBlueprint()));
}
+Test::~Test() {}
void
Test::requireThatWeGetUniqueBlueprints()
diff --git a/searchlib/src/tests/fef/table/table_test.cpp b/searchlib/src/tests/fef/table/table_test.cpp
index a049df231cc..a28c8e3e70f 100644
--- a/searchlib/src/tests/fef/table/table_test.cpp
+++ b/searchlib/src/tests/fef/table/table_test.cpp
@@ -1,16 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("tablemanager_test");
-#include <vespa/vespalib/testkit/testapp.h>
-#include <fstream>
-#include <limits>
-#include <iostream>
+#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/fef/filetablefactory.h>
#include <vespa/searchlib/fef/functiontablefactory.h>
-#include <vespa/searchlib/fef/table.h>
#include <vespa/searchlib/fef/tablemanager.h>
+#include <fstream>
+#include <iostream>
namespace search {
namespace fef {
@@ -29,6 +24,7 @@ private:
const std::string _tables2Dir;
public:
TableTest();
+ ~TableTest();
int Main() override;
};
@@ -39,6 +35,8 @@ TableTest::TableTest() :
{
}
+TableTest::~TableTest() {}
+
bool
TableTest::assertTable(const Table & act, const Table & exp)
{
diff --git a/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp b/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp
index 3bab4acceee..ed8146071e0 100644
--- a/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp
+++ b/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp
@@ -1,7 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("indexmetainfo_test");
+
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/common/indexmetainfo.h>
diff --git a/searchlib/src/tests/memoryindex/btree/frozenbtree_test.cpp b/searchlib/src/tests/memoryindex/btree/frozenbtree_test.cpp
index 93b78bd1b10..c965cc08aa6 100644
--- a/searchlib/src/tests/memoryindex/btree/frozenbtree_test.cpp
+++ b/searchlib/src/tests/memoryindex/btree/frozenbtree_test.cpp
@@ -1,23 +1,18 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("frozenbtree_test");
#define DEBUG_FROZENBTREE
#define LOG_FROZENBTREEXX
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/util/rand48.h>
#include <vespa/searchlib/btree/btreeroot.h>
-#include <vespa/searchlib/btree/btreenodeallocator.h>
#include <vespa/searchlib/btree/btreeiterator.hpp>
#include <vespa/searchlib/btree/btreeroot.hpp>
#include <vespa/searchlib/btree/btreenodeallocator.hpp>
-#include <vespa/searchlib/btree/btreenode.hpp>
-#include <vespa/searchlib/btree/btreenodestore.hpp>
-#include <algorithm>
-#include <limits>
#include <map>
+#include <vespa/log/log.h>
+LOG_SETUP("frozenbtree_test");
+
using search::btree::BTreeRoot;
using search::btree::BTreeNode;
using search::btree::BTreeInternalNode;
@@ -54,82 +49,44 @@ private:
Rand48 _randomGenerator;
- void
- allocTree(void);
-
- void
- freeTree(bool verbose);
-
- void
- fillRandomValues(unsigned int count);
-
- void
- insertRandomValues(Tree &tree,
- NodeAllocator &allocator,
- const std::vector<KeyType> &values);
-
- void
- removeRandomValues(Tree &tree,
- NodeAllocator &allocator,
- const std::vector<KeyType> &values);
-
- void
- lookupRandomValues(const Tree &tree,
- NodeAllocator &allocator,
- const std::vector<KeyType> &values);
-
- void
- lookupGoneRandomValues(const Tree &tree,
- NodeAllocator &allocator,
- const std::vector<KeyType> &values);
-
- void
- lookupFrozenRandomValues(const Tree &tree,
- NodeAllocator &allocator,
- const std::vector<KeyType> &values);
-
- void
- sortRandomValues(void);
-
- void
- traverseTreeIterator(const Tree &tree,
- NodeAllocator &allocator,
- const std::vector<KeyType> &sorted,
- bool frozen);
-
- void
- printSubEnumTree(BTreeNode::Ref node,
- NodeAllocator &allocator,
- int indent) const;
-
- void
- printEnumTree(const Tree *tree,
- NodeAllocator &allocator);
-
- static const char *
- frozenName(bool frozen)
- {
+ void allocTree(void);
+ void freeTree(bool verbose);
+ void fillRandomValues(unsigned int count);
+ void insertRandomValues(Tree &tree, NodeAllocator &allocator, const std::vector<KeyType> &values);
+ void removeRandomValues(Tree &tree, NodeAllocator &allocator, const std::vector<KeyType> &values);
+ void lookupRandomValues(const Tree &tree, NodeAllocator &allocator, const std::vector<KeyType> &values);
+ void lookupGoneRandomValues(const Tree &tree, NodeAllocator &allocator, const std::vector<KeyType> &values);
+ void lookupFrozenRandomValues(const Tree &tree, NodeAllocator &allocator, const std::vector<KeyType> &values);
+ void sortRandomValues();
+ void traverseTreeIterator(const Tree &tree, NodeAllocator &allocator,
+ const std::vector<KeyType> &sorted, bool frozen);
+
+ void printSubEnumTree(BTreeNode::Ref node, NodeAllocator &allocator, int indent) const;
+ void printEnumTree(const Tree *tree, NodeAllocator &allocator);
+
+ static const char *frozenName(bool frozen) {
return frozen ? "frozen" : "thawed";
}
public:
- FrozenBTreeTest(void)
- : vespalib::TestApp(),
- _randomValues(),
- _sortedRandomValues(),
- _generationHandler(NULL),
- _allocator(NULL),
- _tree(NULL),
- _randomGenerator()
- {
- }
+ FrozenBTreeTest();
+ ~FrozenBTreeTest();
- int Main(void) override;
+ int Main() override;
};
-
+FrozenBTreeTest::FrozenBTreeTest()
+ : vespalib::TestApp(),
+ _randomValues(),
+ _sortedRandomValues(),
+ _generationHandler(NULL),
+ _allocator(NULL),
+ _tree(NULL),
+ _randomGenerator()
+{}
+FrozenBTreeTest::~FrozenBTreeTest() {}
void
-FrozenBTreeTest::allocTree(void)
+FrozenBTreeTest::allocTree()
{
assert(_generationHandler == NULL);
assert(_allocator == NULL);
@@ -193,8 +150,7 @@ FrozenBTreeTest::fillRandomValues(unsigned int count)
{
unsigned int i;
- LOG(info,
- "Filling %u random values", count);
+ LOG(info, "Filling %u random values", count);
_randomValues.clear();
_randomValues.reserve(count);
_randomGenerator.srand48(42);
diff --git a/searchlib/src/tests/nativerank/nativerank.cpp b/searchlib/src/tests/nativerank/nativerank.cpp
index 4c03f14e141..e9fb147dc3b 100644
--- a/searchlib/src/tests/nativerank/nativerank.cpp
+++ b/searchlib/src/tests/nativerank/nativerank.cpp
@@ -1,7 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("nativerank_test");
#include <vespa/searchlib/features/nativeattributematchfeature.h>
#include <vespa/searchlib/features/nativefieldmatchfeature.h>
@@ -16,6 +13,9 @@ LOG_SETUP("nativerank_test");
#include <vespa/searchlib/fef/test/ftlib.h>
#include <vespa/searchlib/fef/test/dummy_dependency_handler.h>
+#include <vespa/log/log.h>
+LOG_SETUP("nativerank_test");
+
using namespace search::fef;
using namespace search::fef::test;
using CollectionType = FieldInfo::CollectionType;
@@ -56,9 +56,12 @@ private:
void testNativeRank();
public:
+ ~Test();
int Main() override;
};
+Test::~Test() {}
+
void
Test::testNativeFieldMatch()
{
diff --git a/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp b/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp
index e231af20361..d17ab183c0c 100644
--- a/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp
+++ b/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp
@@ -163,8 +163,8 @@ public:
Test()
: vespalib::TestApp(),
_md(MatchData::makeTestInstance(100, 10))
- {
- }
+ {}
+ ~Test() {}
Blueprint::UP buildBlueprint1();
Blueprint::UP buildBlueprint2();
void testBlueprintBuilding();
diff --git a/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp b/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp
index 4f99f01c290..dc0282c8ae2 100644
--- a/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp
+++ b/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp
@@ -1,7 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("multibitvectoriterator_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/queryeval/multibitvectoriterator.h>
#include <vespa/searchlib/queryeval/emptysearch.h>
@@ -10,6 +8,8 @@ LOG_SETUP("multibitvectoriterator_test");
#include <vespa/searchlib/queryeval/orsearch.h>
#include <vespa/searchlib/fef/termfieldmatchdata.h>
#include <vespa/searchlib/fef/termfieldmatchdataarray.h>
+#include <vespa/log/log.h>
+LOG_SETUP("multibitvectoriterator_test");
using namespace search::queryeval;
using namespace search::fef;
@@ -20,6 +20,7 @@ using namespace search;
class Test : public vespalib::TestApp
{
public:
+ ~Test() {}
void benchmark();
int Main() override;
template <typename T>
diff --git a/searchlib/src/tests/ranksetup/ranksetup_test.cpp b/searchlib/src/tests/ranksetup/ranksetup_test.cpp
index 46e646b6493..608471a4dc0 100644
--- a/searchlib/src/tests/ranksetup/ranksetup_test.cpp
+++ b/searchlib/src/tests/ranksetup/ranksetup_test.cpp
@@ -1,11 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/testapp.h>
-
-#include <map>
-#include <string>
-#include <vector>
-
#include <vespa/searchlib/common/feature.h>
#include <vespa/searchlib/attribute/attributeguard.h>
@@ -247,6 +242,7 @@ private:
public:
RankSetupTest();
+ ~RankSetupTest();
int Main() override;
};
@@ -903,6 +899,7 @@ RankSetupTest::RankSetupTest() :
_queryEnv.overrideAttributeManager(&_manager);
}
+RankSetupTest::~RankSetupTest() {}
int
RankSetupTest::Main()