aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-01-04 14:32:13 +0100
committerGitHub <noreply@github.com>2021-01-04 14:32:13 +0100
commitd0967adbf1d398220abfef406a6a8dde3a18c102 (patch)
tree05d872b680da19bb04282d48e321b4a9f3123399
parent293a2d0b51bf704a190a396b388ca1ebc54f84e5 (diff)
parent88daa788cb2ea5155a0b8093e30e1ce3cefa11ed (diff)
Merge pull request #15894 from vespa-engine/toregge/use-stricter-version-of-dynamic-cast
Use stricter version of dynamic_cast.
-rw-r--r--searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp2
-rw-r--r--storage/src/tests/distributor/putoperationtest.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp
index e3d84683d70..5171db3ef04 100644
--- a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp
+++ b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp
@@ -650,7 +650,7 @@ Verifier<T, A>::Verifier(const std::vector<T> & keys, const vespalib::string & k
size_t i(0);
for (uint32_t doc : getExpectedDocIds()) {
EXPECT_TRUE(nullptr != dynamic_cast<A *>(_attribute.get()));
- EXPECT_TRUE(dynamic_cast<A *>(_attribute.get())->update(doc, keys[(i++)%keys.size()]));
+ EXPECT_TRUE(dynamic_cast<A &>(*_attribute).update(doc, keys[(i++)%keys.size()]));
}
_attribute->commit(true);
_sc = SearchContextTest::getSearch(*_attribute, keyAsString);
diff --git a/storage/src/tests/distributor/putoperationtest.cpp b/storage/src/tests/distributor/putoperationtest.cpp
index 9838bd9be01..bdb5eb9eb4d 100644
--- a/storage/src/tests/distributor/putoperationtest.cpp
+++ b/storage/src/tests/distributor/putoperationtest.cpp
@@ -66,7 +66,7 @@ public:
std::shared_ptr<api::StorageCommand> msg = _sender.command(idx);
api::StorageReply::SP reply(msg->makeReply().release());
- dynamic_cast<api::BucketInfoReply*>(reply.get())->setBucketInfo(info);
+ dynamic_cast<api::BucketInfoReply&>(*reply).setBucketInfo(info);
reply->setResult(result);
op->receive(_sender, reply);