diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-03 14:00:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-03 14:00:59 +0200 |
commit | 40f313056fd479ab2b19132f308de1aa640b669e (patch) | |
tree | f3c02e1d37a849323925d9f42feda2c87bf40871 | |
parent | ae0c8a912c94e2afed7a2d60158d21fedce7a92c (diff) |
Revert "Fix warnings hidden earlier due to including application headers as s…"
26 files changed, 197 insertions, 153 deletions
diff --git a/searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp b/searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp index 525643e377c..03b5931c6b9 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(100001u, afterSpace.dead()); + EXPECT_EQUAL(100001, 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(65536u, afterSpace.dead()); + EXPECT_GREATER(65536, 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 3621537c8fd..b46875cf3e6 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(42u, f.imported_attr->getNumDocs()); + EXPECT_EQUAL(42, 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 f50767d22b3..af57eec46b1 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(101u, ctx->approximateHits()); + EXPECT_EQUAL(101, 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 e41045c2aae..20590a11da0 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,17 +1,16 @@ // 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> @@ -45,7 +44,8 @@ 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(0u, f.size()); + EXPECT_EQUAL(0, 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 35e702dcaf1..271b062ebcd 100644 --- a/searchlib/src/tests/attribute/postinglist/postinglist.cpp +++ b/searchlib/src/tests/attribute/postinglist/postinglist.cpp @@ -1,5 +1,15 @@ // 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> @@ -7,12 +17,6 @@ #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 { @@ -211,27 +215,26 @@ private: return frozen ? "frozen" : "thawed"; } public: - AttributePostingListTest(); - ~AttributePostingListTest(); + AttributePostingListTest(void) + : vespalib::TestApp(), + _randomValues(), + _handler(), + _intKeyStore(NULL), + _intNodeAlloc(NULL), + _intTree(NULL), + _intPostings(NULL), + _stlTree(NULL), + _randomGenerator() + { + } 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() +AttributePostingListTest::allocTree(void) { _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 255d22d1636..8e624c2556a 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(0u, result.est_hits); + EXPECT_EQUAL(0, 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 ddd2bd13707..618adb006d6 100644 --- a/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp +++ b/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp @@ -280,7 +280,6 @@ private: public: SearchContextTest(); - ~SearchContextTest(); int Main() override; }; @@ -1894,8 +1893,6 @@ 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 9361b35ada9..cd6ae2c2567 100644 --- a/searchlib/src/tests/common/rcuvector/rcuvector_test.cpp +++ b/searchlib/src/tests/common/rcuvector/rcuvector_test.cpp @@ -1,5 +1,7 @@ // 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> @@ -276,8 +278,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(2048u, f.vec.size()); - EXPECT_EQUAL(3072u, f.vec.capacity()); + EXPECT_EQUAL(2048, f.vec.size()); + EXPECT_EQUAL(3072, 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 966a3243011..aace9f6988a 100644 --- a/searchlib/src/tests/datastore/array_store/array_store_test.cpp +++ b/searchlib/src/tests/datastore/array_store/array_store_test.cpp @@ -1,10 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include <vespa/searchlib/datastore/array_store.hpp> -#include <vespa/searchlib/test/datastore/memstats.h> +#include <vespa/fastos/fastos.h> +#include <vespa/log/log.h> +LOG_SETUP("array_store_test"); #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; @@ -314,8 +316,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(3u, f.store.addressSpaceUsage().used()); - EXPECT_EQUAL(1u, f.store.addressSpaceUsage().dead()); + EXPECT_EQUAL(3, f.store.addressSpaceUsage().used()); + EXPECT_EQUAL(1, 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 e5e22c58cae..bc7a446b3b4 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,5 +1,7 @@ // 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> @@ -39,7 +41,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(3u, f.cfg.maxSmallArraySize()); + EXPECT_EQUAL(3, 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))); @@ -51,7 +53,7 @@ TEST_F("require that we can generate config optimized for a given huge page", Fi 4 * KB, 8 * KB)) { - EXPECT_EQUAL(1024u, f.cfg.maxSmallArraySize()); + EXPECT_EQUAL(1024, 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 2eb0fda6fbe..adabe0e2679 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,7 +63,6 @@ private: void requireThatSearchIteratorsConforms(); public: Test(); - ~Test(); int Main() override; }; @@ -283,8 +282,6 @@ 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 cb41099da28..3fac4cbb954 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(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]); + 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]); } namespace { void verifyAB(const BlobSet & a) { - EXPECT_EQUAL(0u, a.get(8).size()); - EXPECT_EQUAL(6u, a.get(7).size()); - EXPECT_EQUAL(5u, a.get(9).size()); + EXPECT_EQUAL(0, a.get(8).size()); + EXPECT_EQUAL(6, a.get(7).size()); + EXPECT_EQUAL(5, 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(11u, a.getBuffer().size()); + EXPECT_EQUAL(11, 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 c1cd330df87..f53423a4981 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 ssize_t FILE_SIZE = 4096*3; + constexpr size_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(8u, sizeof(LidInfo)); + EXPECT_EQUAL(8, 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(0xffffu, a.getFileId()); - EXPECT_EQUAL(0x3fffffu, a.getChunkId()); + EXPECT_EQUAL(0xffff, a.getFileId()); + EXPECT_EQUAL(0x3fffff, 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 420baf29bc1..fcb769faef6 100644 --- a/searchlib/src/tests/features/beta/beta_features.cpp +++ b/searchlib/src/tests/features/beta/beta_features.cpp @@ -1,4 +1,7 @@ // 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> @@ -32,8 +35,8 @@ #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/test/plugin/setup.h> #include <vespa/searchlib/util/rand48.h> -#include <vespa/searchlib/fef/test/ftlib.h> #include <vespa/vespalib/util/stringfmt.h> +#include <vespa/searchlib/fef/test/ftlib.h> using namespace search::features; using namespace search::fef; @@ -61,8 +64,6 @@ public: //--------------------------------------------------------------------------------------------------------------------- class Test : public FtTestApp { public: - Test(); - ~Test(); int Main() override; void testJaroWinklerDistance(); void testProximity(); @@ -83,9 +84,6 @@ 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 7e43b0e46e0..40345b1c023 100644 --- a/searchlib/src/tests/features/featurebenchmark.cpp +++ b/searchlib/src/tests/features/featurebenchmark.cpp @@ -1,4 +1,12 @@ // 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> @@ -13,11 +21,6 @@ #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; @@ -128,16 +131,13 @@ private: void runNativeProximity(Config & cfg); public: - Benchmark(); - ~Benchmark(); + Benchmark() : _factory(), _timer(), _sample() {} 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, "="); - assert(values.size() == 2); + LOG_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 cc839703c98..5722a61a1f5 100644 --- a/searchlib/src/tests/features/prod_features.h +++ b/searchlib/src/tests/features/prod_features.h @@ -9,8 +9,6 @@ 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 089002b2b78..f2fc7016751 100644 --- a/searchlib/src/tests/features/prod_features_fieldmatch.cpp +++ b/searchlib/src/tests/features/prod_features_fieldmatch.cpp @@ -1,10 +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(".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"); +#include <vespa/searchlib/features/fieldmatchfeature.h> using namespace search::features; using namespace search::fef; @@ -12,9 +15,6 @@ 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 c7400d5815b..b63cf82a54e 100644 --- a/searchlib/src/tests/fef/properties/properties_test.cpp +++ b/searchlib/src/tests/fef/properties/properties_test.cpp @@ -1,4 +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/vespalib/testkit/test_kit.h> #include <vespa/searchlib/fef/indexproperties.h> #include <vespa/searchlib/fef/properties.h> @@ -277,9 +278,9 @@ TEST("test stuff") { { // vespa.matching.minhitsperthread EXPECT_EQUAL(matching::MinHitsPerThread::NAME, vespalib::string("vespa.matching.minhitsperthread")); - EXPECT_EQUAL(matching::MinHitsPerThread::DEFAULT_VALUE, 0u); + EXPECT_EQUAL(matching::MinHitsPerThread::DEFAULT_VALUE, 0); Properties p; - EXPECT_EQUAL(matching::MinHitsPerThread::lookup(p), 0u); + EXPECT_EQUAL(matching::MinHitsPerThread::lookup(p), 0); 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 37a46861931..e7805f123ef 100644 --- a/searchlib/src/tests/fef/resolver/resolver_test.cpp +++ b/searchlib/src/tests/fef/resolver/resolver_test.cpp @@ -1,13 +1,12 @@ // 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 { @@ -60,7 +59,6 @@ private: void requireThatWeGetUniqueBlueprints(); public: Test(); - ~Test(); int Main() override; }; @@ -70,7 +68,6 @@ 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 a28c8e3e70f..a049df231cc 100644 --- a/searchlib/src/tests/fef/table/table_test.cpp +++ b/searchlib/src/tests/fef/table/table_test.cpp @@ -1,11 +1,16 @@ // 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/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 { @@ -24,7 +29,6 @@ private: const std::string _tables2Dir; public: TableTest(); - ~TableTest(); int Main() override; }; @@ -35,8 +39,6 @@ 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 ed8146071e0..3bab4acceee 100644 --- a/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp +++ b/searchlib/src/tests/indexmetainfo/indexmetainfo_test.cpp @@ -1,5 +1,7 @@ // 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 c965cc08aa6..93b78bd1b10 100644 --- a/searchlib/src/tests/memoryindex/btree/frozenbtree_test.cpp +++ b/searchlib/src/tests/memoryindex/btree/frozenbtree_test.cpp @@ -1,18 +1,23 @@ // 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; @@ -49,44 +54,82 @@ 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 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); + + 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(); - ~FrozenBTreeTest(); + FrozenBTreeTest(void) + : vespalib::TestApp(), + _randomValues(), + _sortedRandomValues(), + _generationHandler(NULL), + _allocator(NULL), + _tree(NULL), + _randomGenerator() + { + } - int Main() override; + int Main(void) override; }; -FrozenBTreeTest::FrozenBTreeTest() - : vespalib::TestApp(), - _randomValues(), - _sortedRandomValues(), - _generationHandler(NULL), - _allocator(NULL), - _tree(NULL), - _randomGenerator() -{} -FrozenBTreeTest::~FrozenBTreeTest() {} + void -FrozenBTreeTest::allocTree() +FrozenBTreeTest::allocTree(void) { assert(_generationHandler == NULL); assert(_allocator == NULL); @@ -150,7 +193,8 @@ 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 e9fb147dc3b..4c03f14e141 100644 --- a/searchlib/src/tests/nativerank/nativerank.cpp +++ b/searchlib/src/tests/nativerank/nativerank.cpp @@ -1,4 +1,7 @@ // 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> @@ -13,9 +16,6 @@ #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,12 +56,9 @@ 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 d17ab183c0c..e231af20361 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 dc0282c8ae2..4f99f01c290 100644 --- a/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp +++ b/searchlib/src/tests/queryeval/multibitvectoriterator/multibitvectoriterator_bench.cpp @@ -1,5 +1,7 @@ // 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> @@ -8,8 +10,6 @@ #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,7 +20,6 @@ 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 608471a4dc0..46e646b6493 100644 --- a/searchlib/src/tests/ranksetup/ranksetup_test.cpp +++ b/searchlib/src/tests/ranksetup/ranksetup_test.cpp @@ -1,6 +1,11 @@ // 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> @@ -242,7 +247,6 @@ private: public: RankSetupTest(); - ~RankSetupTest(); int Main() override; }; @@ -899,7 +903,6 @@ RankSetupTest::RankSetupTest() : _queryEnv.overrideAttributeManager(&_manager); } -RankSetupTest::~RankSetupTest() {} int RankSetupTest::Main() |