summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-10-03 10:41:13 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-10-03 16:52:38 +0000
commit4b67168ee8e303186f143f093a2a31ed6593d8a6 (patch)
tree00886372481d4b9dfe3cf0fce2dd36f1b93fdb1e /searchlib
parent45b821c4c984467962129cd70f2ddd3608f7c9a6 (diff)
make tests pass too
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/datastore/logdatastore_test.cpp4
-rw-r--r--searchlib/src/tests/predicate/document_features_store_test.cpp4
-rw-r--r--searchlib/src/tests/predicate/predicate_index_test.cpp4
-rw-r--r--searchlib/src/tests/predicate/simple_index_test.cpp8
4 files changed, 10 insertions, 10 deletions
diff --git a/searchlib/src/tests/datastore/logdatastore_test.cpp b/searchlib/src/tests/datastore/logdatastore_test.cpp
index 4a045720611..12a7fc28a7b 100644
--- a/searchlib/src/tests/datastore/logdatastore_test.cpp
+++ b/searchlib/src/tests/datastore/logdatastore_test.cpp
@@ -19,6 +19,8 @@ LOG_SETUP("datastore_test");
using document::BucketId;
using namespace search::docstore;
using namespace search;
+using namespace vespalib::alloc;
+using vespalib::DefaultAlloc;
using search::index::DummyFileHeaderContext;
class MyTlSyncer : public transactionlog::SyncProxy {
@@ -144,7 +146,7 @@ TEST("test that DirectIOPadding works accordng to spec") {
FastOS_File file("directio.test");
file.EnableDirectIO();
EXPECT_TRUE(file.OpenReadWrite());
- vespalib::AlignedHeapAlloc buf(FILE_SIZE, 4096);
+ Alloc buf(DefaultAlloc::create(FILE_SIZE, MMapAllocator::HUGEPAGE_SIZE, 4096));
memset(buf.get(), 'a', buf.size());
EXPECT_EQUAL(FILE_SIZE, file.Write2(buf.get(), FILE_SIZE));
size_t padBefore(0);
diff --git a/searchlib/src/tests/predicate/document_features_store_test.cpp b/searchlib/src/tests/predicate/document_features_store_test.cpp
index 4baf2d03fbe..d8ac53a9582 100644
--- a/searchlib/src/tests/predicate/document_features_store_test.cpp
+++ b/searchlib/src/tests/predicate/document_features_store_test.cpp
@@ -191,7 +191,7 @@ TEST("require that DocumentFeaturesStore can be serialized") {
expectHash("foo=bar", features);
expectHash("foo=100-199", features);
- vespalib::MMapDataBuffer buffer;
+ vespalib::DataBuffer buffer;
features_store.serialize(buffer);
DocumentFeaturesStore features_store2(buffer);
@@ -213,7 +213,7 @@ TEST("require that serialization cleans up wordstore") {
features_store.remove(doc_id + 1);
EXPECT_EQUAL(672u, features_store.getMemoryUsage().usedBytes());
- vespalib::MMapDataBuffer buffer;
+ vespalib::DataBuffer buffer;
features_store.serialize(buffer);
DocumentFeaturesStore features_store2(buffer);
EXPECT_EQUAL(428u, features_store2.getMemoryUsage().usedBytes());
diff --git a/searchlib/src/tests/predicate/predicate_index_test.cpp b/searchlib/src/tests/predicate/predicate_index_test.cpp
index b22c80294d0..e4d9aeef1f0 100644
--- a/searchlib/src/tests/predicate/predicate_index_test.cpp
+++ b/searchlib/src/tests/predicate/predicate_index_test.cpp
@@ -277,7 +277,7 @@ TEST("require that PredicateIndex can be (de)serialized") {
}
index.commit();
- vespalib::MMapDataBuffer buffer;
+ vespalib::DataBuffer buffer;
index.serialize(buffer);
uint32_t doc_id_limit;
DocIdLimitFinder finder(doc_id_limit);
@@ -323,7 +323,7 @@ TEST("require that DocumentFeaturesStore is restored on deserialization") {
EXPECT_FALSE(index.getIntervalIndex().lookup(hash).valid());
indexFeature(index, doc_id, min_feature,
{{hash, interval}}, {{hash2, bounds}});
- vespalib::MMapDataBuffer buffer;
+ vespalib::DataBuffer buffer;
index.serialize(buffer);
uint32_t doc_id_limit;
DocIdLimitFinder finder(doc_id_limit);
diff --git a/searchlib/src/tests/predicate/simple_index_test.cpp b/searchlib/src/tests/predicate/simple_index_test.cpp
index d9cbd473ebf..59e4fc53c05 100644
--- a/searchlib/src/tests/predicate/simple_index_test.cpp
+++ b/searchlib/src/tests/predicate/simple_index_test.cpp
@@ -24,15 +24,13 @@ struct MyData {
};
struct MyDataSerializer : PostingSerializer<MyData> {
- void serialize(const MyData &data,
- vespalib::MMapDataBuffer& buffer) const {
+ void serialize(const MyData &data, vespalib::DataBuffer& buffer) const {
buffer.writeInt32(data.data);
}
};
struct MyDataDeserializer : PostingDeserializer<MyData> {
- MyData deserialize(vespalib::MMapDataBuffer& buffer) {
- return {buffer.readInt32()};
+ MyData deserialize(vespalib::DataBuffer& buffer) { return {buffer.readInt32()};
}
};
@@ -168,7 +166,7 @@ TEST_FF("require that SimpleIndex can be serialized and deserialized.", Fixture,
f1.addPosting(key, id, {id});
}
f1.commit();
- vespalib::MMapDataBuffer buffer;
+ vespalib::DataBuffer buffer;
f1.index().serialize(buffer, MyDataSerializer());
MyObserver observer;
MyDataDeserializer deserializer;