From: Matteo Martincigh Date: Thu, 29 Aug 2019 15:26:10 +0000 (+0100) Subject: Add a check for the number of output types to ExecuteNetwork X-Git-Tag: submit/tizen/20200316.035456~314 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08b518687d2bf2683a2c5f571d3e76d71d67d048;p=platform%2Fupstream%2Farmnn.git 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 --- 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 @@ int RunTest(const std::string& format, //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; }