aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/test/TensorHelpers.hpp
diff options
context:
space:
mode:
authorColm Donelan <Colm.Donelan@arm.com>2021-05-17 13:01:52 +0100
committerColm Donelan <Colm.Donelan@arm.com>2021-05-18 11:25:13 +0100
commit25ab3a8326a9e2c52c84b2747fa72907109a695d (patch)
tree1d4eaaf5b41c68a4e3b3ce2cc400c3ffd76d510c /src/armnn/test/TensorHelpers.hpp
parent1d239f5717e6e4adc47683e30a48b05e7511c734 (diff)
downloadarmnn-25ab3a8326a9e2c52c84b2747fa72907109a695d.tar.gz
IVGCVSW-5964 Removing some remaining boost utility usages from tests.
* Adding a basic PredicateResult class to replace boost::test_tools::predicate_result * Replacing all uses of boost::test_tools::predicate_result with the new armnn::PredicateResult class * Replacing use of boost::test_tools::output_test_stream output with std::ostringstream in ProfilerTests.cpp Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I75cdbbff98d984e26e4a50c125386b2988516fad
Diffstat (limited to 'src/armnn/test/TensorHelpers.hpp')
-rw-r--r--src/armnn/test/TensorHelpers.hpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/armnn/test/TensorHelpers.hpp b/src/armnn/test/TensorHelpers.hpp
index fd9dd83770..ceb6d0f9d7 100644
--- a/src/armnn/test/TensorHelpers.hpp
+++ b/src/armnn/test/TensorHelpers.hpp
@@ -4,6 +4,7 @@
//
#pragma once
+#include "PredicateResult.hpp"
#include <armnn/Tensor.hpp>
#include <armnn/utility/Assert.hpp>
#include <armnnUtils/FloatingPointComparison.hpp>
@@ -70,7 +71,7 @@ bool SelectiveCompareBoolean(T a, T b)
};
template <typename T, std::size_t n>
-boost::test_tools::predicate_result CompareTensors(const boost::multi_array<T, n>& a,
+armnn::PredicateResult CompareTensors(const boost::multi_array<T, n>& a,
const boost::multi_array<T, n>& b,
bool compareBoolean = false,
bool isDynamic = false)
@@ -84,8 +85,8 @@ boost::test_tools::predicate_result CompareTensors(const boost::multi_array<T, n
{
if (a.shape()[i] != b.shape()[i])
{
- boost::test_tools::predicate_result res(false);
- res.message() << "Different shapes ["
+ armnn::PredicateResult res(false);
+ res.Message() << "Different shapes ["
<< a.shape()[i]
<< "!="
<< b.shape()[i]
@@ -162,16 +163,16 @@ boost::test_tools::predicate_result CompareTensors(const boost::multi_array<T, n
}
}
- boost::test_tools::predicate_result comparisonResult(true);
+ armnn::PredicateResult comparisonResult(true);
if (numFailedElements > 0)
{
- comparisonResult = false;
- comparisonResult.message() << numFailedElements << " different values at: ";
+ comparisonResult.SetResult(false);
+ comparisonResult.Message() << numFailedElements << " different values at: ";
if (numFailedElements > maxReportedDifferences)
{
errorString << ", ... (and " << (numFailedElements - maxReportedDifferences) << " other differences)";
}
- comparisonResult.message() << errorString.str();
+ comparisonResult.Message() << errorString.str();
}
return comparisonResult;