aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMoritz Pflanzer <moritz.pflanzer@arm.com>2017-07-27 15:15:55 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:16:42 +0100
commitb9e9cff3a9293c60b53683ccfbf2c50dbbbbf44e (patch)
treec3fb53faf7a0644ab7fe7a6947274f2e38bd619f /tests
parentfa811656a2bd39bcabfc7f52270f1f5d655e0537 (diff)
downloadComputeLibrary-b9e9cff3a9293c60b53683ccfbf2c50dbbbbf44e.tar.gz
COMPMID-415: Print tolerance on error
Change-Id: Ie9e85043ba0365ccc6223f5f27c7d852981ee699 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/81878 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/validation_new/Validation.cpp4
-rw-r--r--tests/validation_new/Validation.h5
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/validation_new/Validation.cpp b/tests/validation_new/Validation.cpp
index 9071663e7c..a492bb6505 100644
--- a/tests/validation_new/Validation.cpp
+++ b/tests/validation_new/Validation.cpp
@@ -213,7 +213,7 @@ void validate(const IAccessor &tensor, const void *reference_value)
{
const float percent_mismatches = static_cast<float>(num_mismatches) / num_elements * 100.f;
- ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::setprecision(2) << percent_mismatches << "%) mismatched");
+ ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::fixed << std::setprecision(2) << percent_mismatches << "%) mismatched");
ARM_COMPUTE_EXPECT_EQUAL(num_mismatches, 0, framework::LogLevel::ERRORS);
}
}
@@ -290,7 +290,7 @@ void validate(const IAccessor &tensor, BorderSize border_size, const BorderMode
{
const float percent_mismatches = static_cast<float>(num_mismatches) / num_elements * 100.f;
- ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::setprecision(2) << percent_mismatches << "%) mismatched");
+ ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::fixed << std::setprecision(2) << percent_mismatches << "%) mismatched");
ARM_COMPUTE_EXPECT_EQUAL(num_mismatches, 0, framework::LogLevel::ERRORS);
}
}
diff --git a/tests/validation_new/Validation.h b/tests/validation_new/Validation.h
index 7db7b00886..91b17145be 100644
--- a/tests/validation_new/Validation.h
+++ b/tests/validation_new/Validation.h
@@ -34,6 +34,7 @@
#include "tests/Utils.h"
#include <iomanip>
+#include <ios>
#include <vector>
namespace arm_compute
@@ -203,6 +204,7 @@ void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, const V
ARM_COMPUTE_TEST_INFO("channel = " << c);
ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << target_value);
ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << reference_value);
+ ARM_COMPUTE_TEST_INFO("tolerance = " << std::setprecision(5) << tolerance_value);
ARM_COMPUTE_EXPECT_EQUAL(target_value, reference_value, framework::LogLevel::DEBUG);
++num_mismatches;
@@ -218,7 +220,7 @@ void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, const V
const int64_t absolute_tolerance_number = tolerance_number * num_elements;
const float percent_mismatches = static_cast<float>(num_mismatches) / num_elements * 100.f;
- ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::setprecision(2) << percent_mismatches
+ ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::fixed << std::setprecision(2) << percent_mismatches
<< "%) mismatched (maximum tolerated " << std::setprecision(2) << tolerance_number << "%)");
ARM_COMPUTE_EXPECT(num_mismatches <= absolute_tolerance_number, framework::LogLevel::ERRORS);
}
@@ -231,6 +233,7 @@ void validate(T target, T ref, U tolerance_abs_error, double tolerance_relative_
ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << ref);
ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << target);
+ ARM_COMPUTE_TEST_INFO("tolerance = " << std::setprecision(5) << tolerance_abs_error);
ARM_COMPUTE_EXPECT(equal, framework::LogLevel::ERRORS);
}
} // namespace validation