summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2019-02-08 18:50:50 +0100
committerTor Egge <Tor.Egge@broadpark.no>2019-02-08 18:50:50 +0100
commit429d871df49ab9479a7e6c431a2fa44577a29024 (patch)
tree6b51c8a9cafc024fc2f39dd64a01d1f8993e4152 /searchcore/src/tests
parent63cd60257711b02a435a92fa0cc3c2fb7b976d9b (diff)
Eliminate some clang warnings in searchcore.
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r--searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp4
-rw-r--r--searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp4
-rw-r--r--searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp1
-rw-r--r--searchcore/src/tests/proton/flushengine/flushengine_test.cpp4
-rw-r--r--searchcore/src/tests/proton/matching/matching_test.cpp3
-rw-r--r--searchcore/src/tests/proton/matching/query_test.cpp6
-rw-r--r--searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp10
-rw-r--r--searchcore/src/tests/proton/summaryengine/summaryengine.cpp2
9 files changed, 16 insertions, 20 deletions
diff --git a/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp b/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp
index c1626e94809..8c1ad7bf551 100644
--- a/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/job_tracked_maintenance_job/job_tracked_maintenance_job_test.cpp
@@ -22,7 +22,7 @@ getGateVector(size_t size)
{
GateVector retval;
for (size_t i = 0; i < size; ++i) {
- retval.push_back(std::move(GateUP(new Gate())));
+ retval.push_back(GateUP(new Gate()));
}
return retval;
}
diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
index 4a3ced6891c..c3974368e54 100644
--- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
@@ -1003,7 +1003,6 @@ TEST_F("require that bucket move controller is active",
f._builder.createDocs(3, 1, 3); // 2 docs
f._builder.createDocs(4, 3, 6); // 3 docs
test::UserDocuments notReadyDocs(f._builder.getDocs());
- BucketId bucketId3(notReadyDocs.getBucket(3));
BucketId bucketId4(notReadyDocs.getBucket(4));
f.insertDocs(notReadyDocs, f._notReady);
f._builder.clearDocs();
@@ -1053,15 +1052,12 @@ TEST_F("require that document pruner is active",
f._builder.createDocs(1, 1, 4); // 3 docs
f._builder.createDocs(2, 4, 6); // 2 docs
test::UserDocuments keepDocs(f._builder.getDocs());
- BucketId bucketId1(keepDocs.getBucket(1));
- BucketId bucketId2(keepDocs.getBucket(2));
f.removeDocs(keepDocs, keepTime);
f._builder.clearDocs();
f._builder.createDocs(3, 6, 8); // 2 docs
f._builder.createDocs(4, 8, 11); // 3 docs
test::UserDocuments removeDocs(f._builder.getDocs());
BucketId bucketId3(removeDocs.getBucket(3));
- BucketId bucketId4(removeDocs.getBucket(4));
f.removeDocs(removeDocs, remTime);
f.notifyClusterStateChanged();
EXPECT_TRUE(f._executor.isIdle());
diff --git a/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp b/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
index bbe6db7733e..d436c63ae2e 100644
--- a/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
+++ b/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp
@@ -709,10 +709,10 @@ TEST("requireThatWeCanPutAndRemoveBeforeFreeListConstruct")
EXPECT_EQUAL(2u, dms.getNumUsedLids());
EXPECT_EQUAL(5u, dms.getNumDocs());
// gid1 already there with lid 1
- EXPECT_EXCEPTION(!dms.put(gid1, bucketId1, time1, docSize1, 2).ok(),
+ EXPECT_EXCEPTION(dms.put(gid1, bucketId1, time1, docSize1, 2).ok(),
vespalib::IllegalStateException,
"gid found, but using another lid");
- EXPECT_EXCEPTION(!dms.put(gid5, bucketId5, time5, docSize5, 1).ok(),
+ EXPECT_EXCEPTION(dms.put(gid5, bucketId5, time5, docSize5, 1).ok(),
vespalib::IllegalStateException,
"gid not found, but lid is used by another gid");
EXPECT_TRUE(assertLid(1, gid1, dms));
diff --git a/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp b/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp
index e851e30a31d..18d4fbdb6d7 100644
--- a/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp
+++ b/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp
@@ -91,7 +91,6 @@ const string word1 = "foo";
const string word2 = "bar";
const DocumentIdT doc_id1 = 1;
const DocumentIdT doc_id2 = 2;
-const uint32_t field_id = 1;
Schema getSchema() {
Schema schema;
diff --git a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
index f668072b9fd..96092625979 100644
--- a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
+++ b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
@@ -108,7 +108,7 @@ public:
return std::make_unique<WrappedFlushTask>(std::move(task),
_handler);
}
- return std::move(task);
+ return task;
}
};
@@ -160,7 +160,7 @@ public:
wrappedTargets.push_back(std::make_shared<WrappedFlushTarget>
(target, *this));
}
- return std::move(wrappedTargets);
+ return wrappedTargets;
}
// Called once by flush engine slave thread for each task done
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp
index 7c6779fdc63..2a29847a634 100644
--- a/searchcore/src/tests/proton/matching/matching_test.cpp
+++ b/searchcore/src/tests/proton/matching/matching_test.cpp
@@ -185,10 +185,9 @@ struct MyWorld {
for (uint32_t i = 0; i < NUM_DOCS; ++i) {
document::DocumentId docId(vespalib::make_string("doc::%u", i));
const document::GlobalId &gid = docId.getGlobalId();
- typedef DocumentMetaStore::Result PutRes;
document::BucketId bucketId(BucketFactory::getBucketId(docId));
uint32_t docSize = 1;
- PutRes putRes(metaStore.put(gid, bucketId, Timestamp(0u), docSize, i));
+ metaStore.put(gid, bucketId, Timestamp(0u), docSize, i);
metaStore.setBucketState(bucketId, true);
}
}
diff --git a/searchcore/src/tests/proton/matching/query_test.cpp b/searchcore/src/tests/proton/matching/query_test.cpp
index 82aab72068d..8ecf6fd4a43 100644
--- a/searchcore/src/tests/proton/matching/query_test.cpp
+++ b/searchcore/src/tests/proton/matching/query_test.cpp
@@ -802,7 +802,8 @@ void Test::requireThatWeakAndBlueprintsAreCreatedCorrectly() {
wand.append(Node::UP(new ProtonStringTerm("foo", field, 0, Weight(3))));
wand.append(Node::UP(new ProtonStringTerm("bar", field, 0, Weight(7))));
- ResolveViewVisitor resolve_visitor(ViewResolver(), plain_index_env);
+ ViewResolver viewResolver;
+ ResolveViewVisitor resolve_visitor(viewResolver, plain_index_env);
wand.accept(resolve_visitor);
FakeRequestContext requestContext;
@@ -834,7 +835,8 @@ void Test::requireThatParallelWandBlueprintsAreCreatedCorrectly() {
wand.append(Node::UP(new ProtonStringTerm("foo", field, 0, Weight(3))));
wand.append(Node::UP(new ProtonStringTerm("bar", field, 0, Weight(7))));
- ResolveViewVisitor resolve_visitor(ViewResolver(), attribute_index_env);
+ ViewResolver viewResolver;
+ ResolveViewVisitor resolve_visitor(viewResolver, attribute_index_env);
wand.accept(resolve_visitor);
FakeRequestContext requestContext;
diff --git a/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp b/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp
index b3a7f5f525e..716b369d928 100644
--- a/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp
+++ b/searchcore/src/tests/proton/server/memory_flush_config_updater/memory_flush_config_updater_test.cpp
@@ -89,13 +89,13 @@ TEST_F("require that strategy is updated with conservative max tls size value if
TEST_F("require that strategy is updated with conservative max memory value if memory limit is reached", Fixture)
{
f.notifyDiskMemUsage(belowLimit(), aboveLimit());
- TEST_DO(f.assertStrategyConfig(2, 0.5, 20));
+ TEST_DO(f.assertStrategyConfig(2, 0, 20));
}
TEST_F("require that strategy is updated with all conservative values if both limits are reached", Fixture)
{
f.notifyDiskMemUsage(aboveLimit(), aboveLimit());
- TEST_DO(f.assertStrategyConfig(2, 0.5, 12));
+ TEST_DO(f.assertStrategyConfig(2, 0, 12));
}
TEST_F("require that last disk/memory usage state is remembered when setting new config", Fixture)
@@ -129,11 +129,11 @@ TEST_F("require that we must go below low watermark for disk usage before using
TEST_F("require that we must go below low watermark for memory usage before using normal max memory value again", Fixture)
{
f.notifyDiskMemUsage(belowLimit(), ResourceUsageState(0.7, 0.8));
- TEST_DO(f.assertStrategyConfig(2, 0.5, 20));
+ TEST_DO(f.assertStrategyConfig(2, 0, 20));
f.notifyDiskMemUsage(belowLimit(), ResourceUsageState(0.7, 0.7));
- TEST_DO(f.assertStrategyConfig(2, 0.5, 20));
+ TEST_DO(f.assertStrategyConfig(2, 0, 20));
f.notifyDiskMemUsage(belowLimit(), ResourceUsageState(0.7, 0.56));
- TEST_DO(f.assertStrategyConfig(2, 0.5, 20));
+ TEST_DO(f.assertStrategyConfig(2, 0, 20));
f.notifyDiskMemUsage(belowLimit(), ResourceUsageState(0.7, 0.55));
TEST_DO(f.assertStrategyConfig(4, 1, 20));
f.notifyDiskMemUsage(belowLimit(), ResourceUsageState(0.7, 0.6));
diff --git a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
index 56596ec5bb6..23ef86a46b7 100644
--- a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
+++ b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
@@ -254,7 +254,7 @@ createSlimeRequestLarger(size_t num,
array.addData(Memory(GID1, 12));
array.addData(Memory(GID2, 12));
}
- return std::move(r);
+ return r;
}
Slime