@@ -26,7 +26,8 @@ using namespace std;
26
26
27
27
#ifndef OPENVINO_STATIC_LIBRARY
28
28
29
- inline void mockPlugin (ov::Core& core, std::shared_ptr<ov::IPlugin>& plugin, std::shared_ptr<void >& m_so) {
29
+ namespace {
30
+ void mockPlugin (ov::Core& core, std::shared_ptr<ov::IPlugin>& plugin, std::shared_ptr<void >& m_so) {
30
31
std::string libraryPath = ov::test::utils::get_mock_engine_path ();
31
32
if (!m_so)
32
33
m_so = ov::util::load_shared_object (libraryPath.c_str ());
@@ -36,6 +37,12 @@ inline void mockPlugin(ov::Core& core, std::shared_ptr<ov::IPlugin>& plugin, std
36
37
injectProxyEngine (plugin.get ());
37
38
}
38
39
40
+ void clearMockPlugin (const std::shared_ptr<void >& m_so) {
41
+ ASSERT_TRUE (m_so);
42
+ ov::test::utils::make_std_function<void ()>(m_so, " ClearTargets" )();
43
+ }
44
+ } // namespace
45
+
39
46
TEST (RegisterPluginTests, getVersionforRegisteredPluginThrows) {
40
47
ov::Core core;
41
48
auto plugin = std::make_shared<ov::test::utils::MockPlugin>();
@@ -49,6 +56,7 @@ TEST(RegisterPluginTests, getVersionforRegisteredPluginThrows) {
49
56
std::string (" mock_registered_engine" ) + OV_BUILD_POSTFIX),
50
57
mock_plugin_name));
51
58
ASSERT_THROW (core.get_versions (" MOCK_REGISTERED_HARDWARE" ), ov::Exception);
59
+ clearMockPlugin (m_so);
52
60
}
53
61
54
62
TEST (RegisterPluginTests, getVersionforNoRegisteredPluginNoThrows) {
@@ -113,6 +121,7 @@ TEST(RegisterPluginTests, registerExistingPluginThrows) {
113
121
std::string (" mock_engine" ) + OV_BUILD_POSTFIX),
114
122
mock_plugin_name),
115
123
ov::Exception);
124
+ clearMockPlugin (m_so);
116
125
}
117
126
118
127
inline std::string getPluginFile () {
0 commit comments