diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2021-01-04 13:49:11 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2021-01-04 13:57:47 +0100 |
commit | 88daa788cb2ea5155a0b8093e30e1ce3cefa11ed (patch) | |
tree | 5f2355fb8143ac398bb237d22bf80fc85b5a7cea | |
parent | 2daff17d7e3f7341c8efa4cf9cced09234b17a5e (diff) |
Use stricter version of dynamic_cast.
-rw-r--r-- | searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp | 2 | ||||
-rw-r--r-- | storage/src/tests/distributor/putoperationtest.cpp | 2 |
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); |