diff options
author | Colm Donelan <Colm.Donelan@arm.com> | 2021-05-17 13:01:52 +0100 |
---|---|---|
committer | Colm Donelan <Colm.Donelan@arm.com> | 2021-05-18 11:25:13 +0100 |
commit | 25ab3a8326a9e2c52c84b2747fa72907109a695d (patch) | |
tree | 1d4eaaf5b41c68a4e3b3ce2cc400c3ffd76d510c /src/armnn/test/PredicateResult.hpp | |
parent | 1d239f5717e6e4adc47683e30a48b05e7511c734 (diff) | |
download | armnn-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/PredicateResult.hpp')
-rw-r--r-- | src/armnn/test/PredicateResult.hpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/armnn/test/PredicateResult.hpp b/src/armnn/test/PredicateResult.hpp new file mode 100644 index 0000000000..a344c8e3ad --- /dev/null +++ b/src/armnn/test/PredicateResult.hpp @@ -0,0 +1,48 @@ +// +// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// +#pragma once + +#include <sstream> + +namespace armnn +{ + +class PredicateResult +{ +public: + explicit PredicateResult(bool result) + : m_Result(result) + {} + + PredicateResult(const PredicateResult& predicateResult) + : m_Result(predicateResult.m_Result) + , m_Message(predicateResult.m_Message.str()) + {} + + void SetResult(bool newResult) + { + m_Result = newResult; + } + + std::stringstream& Message() + { + return m_Message; + } + + bool operator!() const + { + return !m_Result; + } + + void operator=(PredicateResult otherPredicateResult) + { + otherPredicateResult.m_Result = m_Result; + } + + bool m_Result; + std::stringstream m_Message; +}; + +} // namespace armnn
\ No newline at end of file |