Add a check for the number of output types to ExecuteNetwork
* If the number of the declared output types does not match
the number of outputs, throw an error (just like we do for
the inputs)
Change-Id: I1cb873bf443a31ecdbc11195462e9614ae3a6637
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
diff --git a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp
index ddf797b..92aa506 100644
--- a/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp
+++ b/tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp
@@ -470,14 +470,20 @@
//Defaults the value of all inputs to "float"
inputTypesVector.assign(inputNamesVector.size(), "float");
}
+ else if ((inputTypesVector.size() != 0) && (inputTypesVector.size() != inputNamesVector.size()))
+ {
+ BOOST_LOG_TRIVIAL(fatal) << "input-name and input-type must have the same amount of elements.";
+ return EXIT_FAILURE;
+ }
+
if (outputTypesVector.size() == 0)
{
//Defaults the value of all outputs to "float"
outputTypesVector.assign(outputNamesVector.size(), "float");
}
- else if ((inputTypesVector.size() != 0) && (inputTypesVector.size() != inputNamesVector.size()))
+ else if ((outputTypesVector.size() != 0) && (outputTypesVector.size() != outputNamesVector.size()))
{
- BOOST_LOG_TRIVIAL(fatal) << "input-name and input-type must have the same amount of elements.";
+ BOOST_LOG_TRIVIAL(fatal) << "output-name and output-type must have the same amount of elements.";
return EXIT_FAILURE;
}