IVGCVSW-7855 removed ASSERTs from armnnUtils code
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Change-Id: Ie26ea2ac4a82d7460ae719fc3154c6a88b079606
diff --git a/src/armnnUtils/ModelAccuracyChecker.cpp b/src/armnnUtils/ModelAccuracyChecker.cpp
index 418737c..83cd0cb 100644
--- a/src/armnnUtils/ModelAccuracyChecker.cpp
+++ b/src/armnnUtils/ModelAccuracyChecker.cpp
@@ -5,6 +5,7 @@
#include "ModelAccuracyChecker.hpp"
+#include <armnn/Exceptions.hpp>
#include <armnn/Logging.hpp>
#include <map>
@@ -63,7 +64,10 @@
// Remove any preceding and trailing character specified in the characterSet.
std::string Strip(const std::string& originalString, const std::string& characterSet)
{
- ARMNN_ASSERT(!characterSet.empty());
+ if (characterSet.empty())
+ {
+ throw armnn::InvalidArgumentException("Strip: string of characters to strip is empty");
+ }
const std::size_t firstFound = originalString.find_first_not_of(characterSet);
const std::size_t lastFound = originalString.find_last_not_of(characterSet);
// Return empty if the originalString is empty or the originalString contains only to-be-striped characters
@@ -73,4 +77,4 @@
}
return originalString.substr(firstFound, lastFound + 1 - firstFound);
}
-} // namespace armnnUtils
\ No newline at end of file
+} // namespace armnnUtils