forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed creation of C++ wrappers from old API (openvinotoolkit#5805)
- Loading branch information
1 parent
8d7411f
commit ce81838
Showing
6 changed files
with
117 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
inference-engine/tests/functional/inference_engine/variable_state.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (C) 2018-2021 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include <cpp/ie_infer_request.hpp> | ||
#include "unit_test_utils/mocks/mock_ie_ivariable_state.hpp" | ||
|
||
using namespace ::testing; | ||
using namespace std; | ||
using namespace InferenceEngine; | ||
using namespace InferenceEngine::details; | ||
|
||
IE_SUPPRESS_DEPRECATED_START | ||
|
||
TEST(VariableStateCPPTests, throwsOnUninitialized) { | ||
std::shared_ptr<IVariableState> ptr; | ||
ASSERT_THROW(VariableState var(ptr), InferenceEngine::NotAllocated); | ||
} | ||
|
||
TEST(VariableStateCPPTests, nothrowOnInitialized) { | ||
std::shared_ptr<IVariableState> ptr = std::make_shared<MockIVariableState>(); | ||
ASSERT_NO_THROW(VariableState var(ptr)); | ||
} | ||
|
||
TEST(VariableStateCPPTests, throwsOnUninitializedGetLastState) { | ||
VariableState req; | ||
ASSERT_THROW(req.GetLastState(), InferenceEngine::NotAllocated); | ||
} | ||
|
||
IE_SUPPRESS_DEPRECATED_END | ||
|
||
TEST(VariableStateCPPTests, throwsOnUninitializedReset) { | ||
VariableState req; | ||
ASSERT_THROW(req.Reset(), InferenceEngine::NotAllocated); | ||
} | ||
|
||
TEST(VariableStateCPPTests, throwsOnUninitializedGetname) { | ||
VariableState req; | ||
ASSERT_THROW(req.GetName(), InferenceEngine::NotAllocated); | ||
} | ||
|
||
TEST(VariableStateCPPTests, throwsOnUninitializedGetState) { | ||
VariableState req; | ||
ASSERT_THROW(req.GetState(), InferenceEngine::NotAllocated); | ||
} | ||
|
||
TEST(VariableStateCPPTests, throwsOnUninitializedSetState) { | ||
VariableState req; | ||
Blob::Ptr blob; | ||
ASSERT_THROW(req.SetState(blob), InferenceEngine::NotAllocated); | ||
} |