Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/src/runtime/allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bool Allocator::operator==(const Allocator& other) const {
if (_impl == other._impl) {
return true;
}
return _impl->is_equal(*other._impl);
return other._impl && other._impl && _impl->is_equal(*other._impl);
});
}

Expand Down
11 changes: 11 additions & 0 deletions src/core/tests/ov_default_allocator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "openvino/core/except.hpp"
#include "openvino/runtime/allocator.hpp"

namespace ov::test {
using ::testing::_;
using OVDefaultAllocatorTest = ::testing::Test;

TEST_F(OVDefaultAllocatorTest, notThrowOnZeroSize) {
Expand Down Expand Up @@ -59,3 +61,12 @@ TEST_F(OVDefaultAllocatorTest, canAllocate10KMemory) {
EXPECT_EQ(ptr[9999], 11);
allocator.deallocate(handle);
}

TEST_F(OVDefaultAllocatorTest, compareIfImplIsNull) {
auto a1 = ov::Allocator();
auto a2 = std::move(a1);

EXPECT_FALSE(a2 == a1);
OV_EXPECT_THROW(std::ignore = (a1 == a2), ov::Exception, _);
}
} // namespace ov::test
4 changes: 2 additions & 2 deletions src/inference/src/dev/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const ov::Version ov::Plugin::get_version() const {
}

void ov::Plugin::set_property(const ov::AnyMap& config) {
m_ptr->set_property(config);
OV_PLUGIN_CALL_STATEMENT(m_ptr->set_property(config));
}

ov::SoPtr<ov::ICompiledModel> ov::Plugin::compile_model(const std::shared_ptr<const ov::Model>& model,
Expand Down Expand Up @@ -108,7 +108,7 @@ ov::SoPtr<ov::IRemoteContext> ov::Plugin::get_default_context(const AnyMap& para
}

ov::Any ov::Plugin::get_property(const std::string& name, const AnyMap& arguments) const {
return {m_ptr->get_property(name, arguments), {m_so}};
OV_PLUGIN_CALL_STATEMENT(return {m_ptr->get_property(name, arguments), {m_so}});
}

bool ov::Plugin::supports_model_caching(const ov::AnyMap& arguments) const {
Expand Down
Loading