From 08f4016b8ae8ee836fc813abcbc7db826924f3ec Mon Sep 17 00:00:00 2001 From: James Ward Date: Mon, 7 Sep 2020 16:45:07 +0100 Subject: IVGCVSW-5293 Remove boost::format from armnn/tests * Replaced boost::format with fmt::format Signed-off-by: James Ward Change-Id: Icf5a6508e7be3d31bc063643491fc5e0607f21fa --- tests/InferenceModel.hpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'tests/InferenceModel.hpp') diff --git a/tests/InferenceModel.hpp b/tests/InferenceModel.hpp index 68ee8ae81a..8ac44f98fb 100644 --- a/tests/InferenceModel.hpp +++ b/tests/InferenceModel.hpp @@ -28,9 +28,9 @@ #include "armnn/utility/StringUtils.hpp" #include #include -#include #include #include +#include #include #include @@ -134,9 +134,9 @@ public: const size_t numInputBindings = params.m_InputBindings.size(); if (numInputShapes < numInputBindings) { - throw armnn::Exception(boost::str(boost::format( - "Not every input has its tensor shape specified: expected=%1%, got=%2%") - % numInputBindings % numInputShapes)); + throw armnn::Exception(fmt::format( + "Not every input has its tensor shape specified: expected={0}, got={1}", + numInputBindings, numInputShapes)); } for (size_t i = 0; i < numInputShapes; i++) @@ -194,10 +194,9 @@ public: fs::path pathToFile(params.m_ModelPath); if (!fs::exists(pathToFile, errorCode)) { - throw armnn::FileNotFoundException(boost::str( - boost::format("Cannot find the file (%1%) errorCode: %2% %3%") % - params.m_ModelPath % - errorCode % + throw armnn::FileNotFoundException(fmt::format("Cannot find the file ({0}) errorCode: {1} {2}", + params.m_ModelPath, + errorCode.message(), CHECK_LOCATION().AsString())); } std::ifstream file(params.m_ModelPath, std::ios::binary); @@ -454,7 +453,7 @@ public: { if (m_InputBindings.size() < inputIndex + 1) { - throw armnn::Exception(boost::str(boost::format("Input index out of range: %1%") % inputIndex)); + throw armnn::Exception(fmt::format("Input index out of range: {}", inputIndex)); } } @@ -462,7 +461,7 @@ public: { if (m_OutputBindings.size() < outputIndex + 1) { - throw armnn::Exception(boost::str(boost::format("Output index out of range: %1%") % outputIndex)); + throw armnn::Exception(fmt::format("Output index out of range: {}", outputIndex)); } } @@ -493,8 +492,8 @@ public: { unsigned int outputIndex = boost::numeric_cast(i); throw armnn::Exception( - boost::str(boost::format("Not enough data for output #%1%: expected " - "%2% elements, got %3%") % outputIndex % expectedOutputDataSize % actualOutputDataSize)); + fmt::format("Not enough data for output #{0}: expected " + "{1} elements, got {2}", outputIndex, expectedOutputDataSize, actualOutputDataSize)); } }, outputContainers[i]); -- cgit v1.2.1