From 232aadf518a5cecfd32ee79bd3cfdb4bb410db0f Mon Sep 17 00:00:00 2001 From: "Wang, Yang" Date: Wed, 1 Dec 2021 14:07:08 +0800 Subject: [PATCH] Add test case for device parameter to LoadNetwork. (#8786) Signed-off-by: Wang, Yang --- .../behavior/plugin/core_integration.cpp | 4 ++++ .../shared/include/behavior/plugin/core_integration.hpp | 7 +++++++ src/inference/src/ie_core.cpp | 3 --- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/plugin/core_integration.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/plugin/core_integration.cpp index 422f585006c..88dd3e01a23 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/plugin/core_integration.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/plugin/core_integration.cpp @@ -99,4 +99,8 @@ INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P( smoke_IEClassLoadNetworkTest, IEClassLoadNetworkTest, ::testing::Values("CPU")); + +INSTANTIATE_TEST_SUITE_P( + smoke_IEClassLoadNetworkTest, IEClassLoadNetworkTestWithThrow, + ::testing::Values("")); } // namespace \ No newline at end of file diff --git a/inference-engine/tests/functional/plugin/shared/include/behavior/plugin/core_integration.hpp b/inference-engine/tests/functional/plugin/shared/include/behavior/plugin/core_integration.hpp index f1731a857f2..3cb94ab5125 100644 --- a/inference-engine/tests/functional/plugin/shared/include/behavior/plugin/core_integration.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/behavior/plugin/core_integration.hpp @@ -53,6 +53,7 @@ public: }; using IEClassNetworkTestP = BehaviorTestsUtils::IEClassBaseTestP; +using IEClassLoadNetworkTestWithThrow = BehaviorTestsUtils::IEClassBaseTestP; using IEClassGetMetricTest = BehaviorTestsUtils::IEClassBaseTestP; using IEClassQueryNetworkTest = BehaviorTestsUtils::IEClassBaseTestP; using IEClassGetMetricTest_SUPPORTED_METRICS = BehaviorTestsUtils::IEClassBaseTestP; @@ -930,6 +931,12 @@ TEST_P(IEClassNetworkTestP, LoadNetworkCreateDefaultExecGraphResult) { } } +TEST_P(IEClassLoadNetworkTestWithThrow, LoadNetworkActualWithThrow) { + SKIP_IF_CURRENT_TEST_IS_DISABLED() + InferenceEngine::Core ie = BehaviorTestsUtils::createIECoreWithTemplate(); + ASSERT_THROW(ie.LoadNetwork(actualCnnNetwork, deviceName), InferenceEngine::Exception); +} + TEST_P(IEClassSeveralDevicesTestLoadNetwork, LoadNetworkActualSeveralDevicesNoThrow) { InferenceEngine::Core ie = BehaviorTestsUtils::createIECoreWithTemplate(); diff --git a/src/inference/src/ie_core.cpp b/src/inference/src/ie_core.cpp index 8cd03ba10ed..5c535af6982 100644 --- a/src/inference/src/ie_core.cpp +++ b/src/inference/src/ie_core.cpp @@ -91,9 +91,6 @@ Parsed parseDeviceNameIntoConfig(const std::string& deviceName, const std::ma deviceName.substr(std::string("AUTO:").size()); } } else { - if (deviceName_.empty()) { - deviceName_ = "AUTO"; - } ie::DeviceIDParser parser(deviceName_); deviceName_ = parser.getDeviceName(); std::string deviceIDLocal = parser.getDeviceID();