From 942912daeb4e1d84820d813c1d3c03eae5361449 Mon Sep 17 00:00:00 2001 From: CNugteren Date: Sun, 8 May 2016 21:11:37 +0200 Subject: [PATCH] Fixes for compilation of the tests under Visual Studio 2015 --- test/correctness/testblas.cc | 4 ++-- test/correctness/tester.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/correctness/testblas.cc b/test/correctness/testblas.cc index 1f83c59b..e70c0361 100644 --- a/test/correctness/testblas.cc +++ b/test/correctness/testblas.cc @@ -145,8 +145,8 @@ void TestBlas::TestRegular(std::vector> &test_vector, const st if (!TestSimilarity(result1[index], result2[index])) { errors++; if (verbose_) { - if (get_id2_(args) == 1) { fprintf(stdout, "\n Error at index %lu: ", id1); } - else { fprintf(stdout, "\n Error at %lu,%lu: ", id1, id2); } + if (get_id2_(args) == 1) { fprintf(stdout, "\n Error at index %zu: ", id1); } + else { fprintf(stdout, "\n Error at %zu,%zu: ", id1, id2); } std::cout << result1[index]; fprintf(stdout, " (reference) versus "); std::cout << result2[index]; diff --git a/test/correctness/tester.cc b/test/correctness/tester.cc index 82926c3c..26c4ba59 100644 --- a/test/correctness/tester.cc +++ b/test/correctness/tester.cc @@ -333,8 +333,8 @@ bool TestSimilarity(const T val1, const T val2) { const auto difference = std::fabs(val1 - val2); // Set the allowed error margin for floating-point comparisons - constexpr auto kErrorMarginRelative = T{0.025}; - constexpr auto kErrorMarginAbsolute = T{1.0e-4}; + constexpr auto kErrorMarginRelative = T(0.025); + constexpr auto kErrorMarginAbsolute = T(1.0e-4); // Shortcut, handles infinities if (val1 == val2) {