summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-12-15 05:17:10 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2016-12-15 13:12:36 +0100
commit2523fa2064bb09005f747fa3bcafe7a731241e98 (patch)
treee6daac946686e85b2464f4a9d86c81986f147b5d
parent1c63902ae04edc5335f6162ea8c20a63c0e3d298 (diff)
Make some more test build too.
-rw-r--r--document/src/tests/documentcalculatortestcase.cpp27
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp1
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.cpp1
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/slotiterator.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/common/bitvectorcache.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/diskindex.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/predicate/predicate_index.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp1
-rw-r--r--staging_vespalib/src/tests/stllike/cache_test.cpp6
-rw-r--r--staging_vespalib/src/tests/stllike/lrucache.cpp6
-rw-r--r--vespalib/src/tests/array/array_test.cpp7
-rw-r--r--vespalib/src/tests/stllike/hash_test.cpp9
-rw-r--r--vespalib/src/tests/stllike/hashtable_test.cpp7
-rw-r--r--vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor.cpp4
15 files changed, 29 insertions, 49 deletions
diff --git a/document/src/tests/documentcalculatortestcase.cpp b/document/src/tests/documentcalculatortestcase.cpp
index 00de5427961..0279d850dfd 100644
--- a/document/src/tests/documentcalculatortestcase.cpp
+++ b/document/src/tests/documentcalculatortestcase.cpp
@@ -1,18 +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/document/base/testdocrepo.h>
-#include <vespa/document/fieldvalue/fieldvalues.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/document/base/documentcalculator.h>
+#include <vespa/document/fieldvalue/document.h>
+#include <vespa/document/fieldvalue/bytefieldvalue.h>
#include <vespa/document/fieldvalue/intfieldvalue.h>
#include <vespa/document/fieldvalue/longfieldvalue.h>
#include <vespa/document/fieldvalue/floatfieldvalue.h>
-#include <fstream>
-
namespace document {
class DocumentCalculatorTest : public CppUnit::TestFixture {
@@ -59,7 +56,7 @@ DocumentCalculatorTest::testConstant() {
Document doc(*_testRepo.getDocumentType("testdoctype1"),
DocumentId("doc:test:foo"));
- CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, variables));
+ CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, std::move(variables)));
}
void
@@ -69,7 +66,7 @@ DocumentCalculatorTest::testSimple() {
Document doc(*_testRepo.getDocumentType("testdoctype1"),
DocumentId("doc:test:foo"));
- CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, variables));
+ CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, std::move(variables)));
}
void
@@ -81,7 +78,7 @@ DocumentCalculatorTest::testVariables() {
Document doc(*_testRepo.getDocumentType("testdoctype1"),
DocumentId("doc:test:foo"));
- CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, variables));
+ CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, std::move(variables)));
}
void
@@ -97,7 +94,7 @@ DocumentCalculatorTest::testFields() {
doc.setValue(doc.getField("headerval"), IntFieldValue(5));
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(2));
- CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, variables));
+ CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, std::move(variables)));
}
void
@@ -114,7 +111,7 @@ DocumentCalculatorTest::testFieldsDivZero() {
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(0));
try {
- calc.evaluate(doc, variables);
+ calc.evaluate(doc, std::move(variables));
CPPUNIT_ASSERT(false);
} catch (const vespalib::IllegalArgumentException& e) {
// OK
@@ -129,7 +126,7 @@ DocumentCalculatorTest::testDivideByZero() {
Document doc(*_testRepo.getDocumentType("testdoctype1"),
DocumentId("doc:test:foo"));
try {
- calc.evaluate(doc, variables);
+ calc.evaluate(doc, std::move(variables));
CPPUNIT_ASSERT(false);
} catch (const vespalib::IllegalArgumentException& e) {
// OK
@@ -144,7 +141,7 @@ DocumentCalculatorTest::testModByZero() {
Document doc(*_testRepo.getDocumentType("testdoctype1"),
DocumentId("doc:test:foo"));
try {
- calc.evaluate(doc, variables);
+ calc.evaluate(doc, std::move(variables));
CPPUNIT_ASSERT(false);
} catch (const vespalib::IllegalArgumentException& e) {
// OK
@@ -162,7 +159,7 @@ DocumentCalculatorTest::testFieldNotSet() {
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(2));
try {
- calc.evaluate(doc, variables);
+ calc.evaluate(doc, std::move(variables));
CPPUNIT_ASSERT(false);
} catch (const vespalib::IllegalArgumentException&) {
// OK
@@ -181,7 +178,7 @@ DocumentCalculatorTest::testFieldNotFound() {
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(2));
try {
- calc.evaluate(doc, variables);
+ calc.evaluate(doc, std::move(variables));
CPPUNIT_ASSERT(false);
} catch (const vespalib::IllegalArgumentException&) {
// OK
@@ -196,7 +193,7 @@ DocumentCalculatorTest::testByteSubtractionZeroResult() {
Document doc(*_testRepo.getDocumentType("testdoctype1"),
DocumentId("doc:test:foo"));
doc.setValue(doc.getField("byteval"), ByteFieldValue(3));
- CPPUNIT_ASSERT_EQUAL(0.0, calc.evaluate(doc, variables));
+ CPPUNIT_ASSERT_EQUAL(0.0, calc.evaluate(doc, std::move(variables)));
}
}
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp
index ecb66058362..cd9cb5f3ee9 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp
@@ -4,7 +4,6 @@
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/memfilepersistence/common/environment.h>
#include <vespa/vespalib/util/crc.h>
-#include <vespa/vespalib/stllike/hash_set.hpp>
#include <vespa/log/log.h>
LOG_SETUP(".memfile.simpleiobuffer");
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.cpp b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.cpp
index 62bbc7f3f4b..b03c9111430 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.cpp
@@ -12,7 +12,6 @@
#include <vespa/memfilepersistence/common/environment.h>
#include <iomanip>
#include <vespa/document/util/stringutil.h>
-#include <vespa/vespalib/stllike/hash_set.hpp>
#include <vespa/log/log.h>
LOG_SETUP(".persistence.memfile.memfile");
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/slotiterator.cpp b/memfilepersistence/src/vespa/memfilepersistence/memfile/slotiterator.cpp
index fba74aeb84d..c4a6d8ce382 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/slotiterator.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/slotiterator.cpp
@@ -2,7 +2,6 @@
#include "slotiterator.h"
#include <vespa/memfilepersistence/memfile/memfile.h>
-#include <vespa/vespalib/stllike/hash_set.hpp>
namespace storage {
namespace memfile {
diff --git a/searchlib/src/vespa/searchlib/common/bitvectorcache.cpp b/searchlib/src/vespa/searchlib/common/bitvectorcache.cpp
index 4fdf938d649..e0eef8d8325 100644
--- a/searchlib/src/vespa/searchlib/common/bitvectorcache.cpp
+++ b/searchlib/src/vespa/searchlib/common/bitvectorcache.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "bitvectorcache.h"
-#include <vespa/vespalib/stllike/hash_set.hpp>
#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/log/log.h>
diff --git a/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp b/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp
index 61897d2785b..a12fb219b91 100644
--- a/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp
+++ b/searchlib/src/vespa/searchlib/diskindex/diskindex.cpp
@@ -7,7 +7,7 @@
#include <vespa/searchlib/queryeval/leaf_blueprints.h>
#include <vespa/searchlib/queryeval/intermediate_blueprints.h>
#include <vespa/searchlib/util/dirtraverse.h>
-#include <vespa/vespalib/stllike/hash_set.hpp>
+#include <vespa/vespalib/stllike/hash_set.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/vespalib/stllike/cache.hpp>
#include "pagedict4randread.h"
diff --git a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp
index 1a845686474..616c2b7631a 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp
+++ b/searchlib/src/vespa/searchlib/memoryindex/memoryindex.cpp
@@ -1,15 +1,15 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "memoryindex.h"
+#include "postingiterator.h"
#include <vespa/searchlib/index/schemautil.h>
-#include <vespa/searchlib/memoryindex/postingiterator.h>
#include <vespa/searchlib/queryeval/create_blueprint_visitor_helper.h>
#include <vespa/searchlib/queryeval/booleanmatchiteratorwrapper.h>
#include <vespa/searchlib/queryeval/emptysearch.h>
#include <vespa/searchlib/queryeval/leaf_blueprints.h>
#include <vespa/searchlib/common/sequencedtaskexecutor.h>
#include <vespa/searchlib/btree/btreenodeallocator.hpp>
-#include <vespa/vespalib/stllike/hash_set.hpp>
+
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.memoryindex.memoryindex");
diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp
index 778c1d8b33c..ef7bde8ac87 100644
--- a/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp
+++ b/searchlib/src/vespa/searchlib/predicate/predicate_index.cpp
@@ -2,7 +2,6 @@
#include "predicate_index.h"
#include "predicate_hash.h"
-#include <vespa/vespalib/stllike/hash_set.hpp>
using search::datastore::EntryRef;
diff --git a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp
index 2cf0046cbb5..ef45289cb53 100644
--- a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp
@@ -8,7 +8,6 @@
#include <vespa/searchlib/predicate/predicate_range_term_expander.h>
#include <vespa/searchlib/predicate/predicate_hash.h>
#include <vespa/searchlib/query/tree/termnodes.h>
-#include <vespa/vespalib/stllike/hash_set.hpp>
#include <vespa/log/log.h>
LOG_SETUP(".predicate_blueprint");
diff --git a/staging_vespalib/src/tests/stllike/cache_test.cpp b/staging_vespalib/src/tests/stllike/cache_test.cpp
index 288ef367be4..892c9bc81c7 100644
--- a/staging_vespalib/src/tests/stllike/cache_test.cpp
+++ b/staging_vespalib/src/tests/stllike/cache_test.cpp
@@ -1,10 +1,8 @@
// 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("cache_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/stllike/string.h>
-#include <vespa/vespalib/stllike/cache.h>
+#include <vespa/vespalib/stllike/cache.hpp>
#include <map>
using namespace vespalib;
diff --git a/staging_vespalib/src/tests/stllike/lrucache.cpp b/staging_vespalib/src/tests/stllike/lrucache.cpp
index de5bcb8a365..bc89325b4ad 100644
--- a/staging_vespalib/src/tests/stllike/lrucache.cpp
+++ b/staging_vespalib/src/tests/stllike/lrucache.cpp
@@ -1,10 +1,8 @@
// 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("lrucache_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/stllike/string.h>
-#include <vespa/vespalib/stllike/lrucache_map.h>
+#include <vespa/vespalib/stllike/lrucache_map.hpp>
using namespace vespalib;
diff --git a/vespalib/src/tests/array/array_test.cpp b/vespalib/src/tests/array/array_test.cpp
index 231bc00611a..fb4a824ec00 100644
--- a/vespalib/src/tests/array/array_test.cpp
+++ b/vespalib/src/tests/array/array_test.cpp
@@ -1,13 +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>
-#include <vespa/vespalib/util/array.h>
+
+#include <vespa/vespalib/util/array.hpp>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <deque>
-LOG_SETUP("array_test");
-
using namespace vespalib;
class Test : public TestApp
diff --git a/vespalib/src/tests/stllike/hash_test.cpp b/vespalib/src/tests/stllike/hash_test.cpp
index cae98bf0e40..095b5b6a5a3 100644
--- a/vespalib/src/tests/stllike/hash_test.cpp
+++ b/vespalib/src/tests/stllike/hash_test.cpp
@@ -1,10 +1,9 @@
// 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("hash_test");
+
#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/stllike/hash_set.h>
-#include <vespa/vespalib/stllike/hash_map.h>
+#include <vespa/vespalib/stllike/hash_set.hpp>
+#include <vespa/vespalib/stllike/hash_map.hpp>
+#include <cstddef>
using namespace vespalib;
using std::make_pair;
diff --git a/vespalib/src/tests/stllike/hashtable_test.cpp b/vespalib/src/tests/stllike/hashtable_test.cpp
index 7516ca1ab34..67cf953aac0 100644
--- a/vespalib/src/tests/stllike/hashtable_test.cpp
+++ b/vespalib/src/tests/stllike/hashtable_test.cpp
@@ -1,11 +1,8 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Unit tests for hashtable.
-#include <vespa/log/log.h>
-LOG_SETUP("hashtable_test");
-#include <vespa/fastos/fastos.h>
-
-#include <vespa/vespalib/stllike/hashtable.h>
+#include <vespa/vespalib/stllike/hashtable.hpp>
+#include <vespa/vespalib/stllike/hash_fun.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <memory>
#include <vector>
diff --git a/vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor.cpp b/vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor.cpp
index 7a0214e2ca1..0e83061a88a 100644
--- a/vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor.cpp
+++ b/vespalib/src/vespa/vespalib/tensor/sparse/sparse_tensor.cpp
@@ -307,6 +307,6 @@ SparseTensor::reduce(const eval::BinaryOperation &op,
} // namespace vespalib::tensor
-template class hash_map<tensor::SparseTensorAddressRef, double>;
-
} // namespace vespalib
+
+VESPALIB_HASH_MAP_INSTANTIATE(vespalib::tensor::SparseTensorAddressRef, double);