From 423d88fb7e35333cd243fbe04a8558fd5ac1489f Mon Sep 17 00:00:00 2001 From: steniu01 Date: Thu, 22 Jun 2017 10:20:37 +0100 Subject: COMPMID-250 handle single float comparision Change-Id: I0007dfba16952d427e73185d9c971e79e9f612c9 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/78507 Reviewed-by: Moritz Pflanzer Tested-by: Kaizen --- tests/validation/NEON/MeanStdDev.cpp | 8 ++++---- tests/validation/Validation.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'tests/validation') diff --git a/tests/validation/NEON/MeanStdDev.cpp b/tests/validation/NEON/MeanStdDev.cpp index 4cb04455ec..4804354551 100644 --- a/tests/validation/NEON/MeanStdDev.cpp +++ b/tests/validation/NEON/MeanStdDev.cpp @@ -123,8 +123,8 @@ BOOST_DATA_TEST_CASE(RunSmall, Small2DShapes(), shape) std::pair ref_output = Reference::compute_reference_mean_and_standard_deviation(shape); // Validate output - BOOST_TEST(static_cast(output.first) == static_cast(ref_output.first)); - BOOST_TEST(static_cast(output.second) == static_cast(ref_output.second)); + validate(output.first, ref_output.first); + validate(output.second, ref_output.second); } BOOST_TEST_DECORATOR(*boost::unit_test::label("nightly")) @@ -137,8 +137,8 @@ BOOST_DATA_TEST_CASE(RunLarge, Large2DShapes(), shape) std::pair ref_output = Reference::compute_reference_mean_and_standard_deviation(shape); // Validate output - BOOST_TEST(static_cast(output.first) == static_cast(ref_output.first)); - BOOST_TEST(static_cast(output.second) == static_cast(ref_output.second)); + validate(output.first, ref_output.first); + validate(output.second, ref_output.second); } BOOST_AUTO_TEST_SUITE_END() diff --git a/tests/validation/Validation.cpp b/tests/validation/Validation.cpp index c1c43c05c4..89f91c0dd9 100644 --- a/tests/validation/Validation.cpp +++ b/tests/validation/Validation.cpp @@ -392,6 +392,16 @@ void validate(std::vector classified_labels, std::vector::epsilon(), float tolerance_relative_error = 0.0001f) +{ + const bool equal = is_equal(target, ref, tolerance_abs_error, tolerance_relative_error); + + BOOST_TEST_INFO("reference = " << std::setprecision(5) << ref); + BOOST_TEST_INFO("target = " << std::setprecision(5) << target); + BOOST_TEST(equal); +} + } // namespace validation } // namespace test } // namespace arm_compute -- cgit v1.2.1