@@ -26,7 +26,8 @@ using namespace std;
2626
2727#ifndef OPENVINO_STATIC_LIBRARY
2828
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) {
3031 std::string libraryPath = ov::test::utils::get_mock_engine_path ();
3132 if (!m_so)
3233 m_so = ov::util::load_shared_object (libraryPath.c_str ());
@@ -36,6 +37,13 @@ inline void mockPlugin(ov::Core& core, std::shared_ptr<ov::IPlugin>& plugin, std
3637 injectProxyEngine (plugin.get ());
3738}
3839
40+ void clearMockPlugin (const std::shared_ptr<void >& m_so) {
41+ std::string libraryPath = ov::test::utils::get_mock_engine_path ();
42+ ASSERT_TRUE (m_so);
43+ ov::test::utils::make_std_function<void ()>(m_so, " ClearTargets" )();
44+ }
45+ } // namespace
46+
3947TEST (RegisterPluginTests, getVersionforRegisteredPluginThrows) {
4048 ov::Core core;
4149 auto plugin = std::make_shared<ov::test::utils::MockPlugin>();
@@ -49,6 +57,7 @@ TEST(RegisterPluginTests, getVersionforRegisteredPluginThrows) {
4957 std::string (" mock_registered_engine" ) + OV_BUILD_POSTFIX),
5058 mock_plugin_name));
5159 ASSERT_THROW (core.get_versions (" MOCK_REGISTERED_HARDWARE" ), ov::Exception);
60+ clearMockPlugin (m_so);
5261}
5362
5463TEST (RegisterPluginTests, getVersionforNoRegisteredPluginNoThrows) {
@@ -113,6 +122,7 @@ TEST(RegisterPluginTests, registerExistingPluginThrows) {
113122 std::string (" mock_engine" ) + OV_BUILD_POSTFIX),
114123 mock_plugin_name),
115124 ov::Exception);
125+ clearMockPlugin (m_so);
116126}
117127
118128inline std::string getPluginFile () {
0 commit comments