From 50b068fb42556f5b75fc5ffe6f69e45aabb6bb30 Mon Sep 17 00:00:00 2001 From: Rene Milk <rene.milk@uni-muenster.de> Date: Wed, 4 Nov 2015 10:31:23 +0100 Subject: [PATCH] [test.common] adjust configuration test refs #62 --- dune/stuff/test/common_configuration.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dune/stuff/test/common_configuration.cc b/dune/stuff/test/common_configuration.cc index bd786b274..9e103d0a3 100644 --- a/dune/stuff/test/common_configuration.cc +++ b/dune/stuff/test/common_configuration.cc @@ -175,8 +175,12 @@ struct ConfigTest : public testing::Test { std::set<std::string> uniq_keys; for (T val : values) { - auto key = key_gen(); - val_compare_eq(val, DSC_CONFIG_GET(key, val)); + const auto key = key_gen(); + const auto got_val = DSC_CONFIG_GET(key, val); + // since the value invariably goes through string conversion, we need to adjust the expected value as well + const T adjusted_val = DSC::fromString<T>(DSC::toString(val)); + val_compare_eq(adjusted_val, got_val); + //! TODO add a float compare check that makes sure introduced error is only due to limited precision in str conv uniq_keys.insert(key); } EXPECT_EQ(values.size(), uniq_keys.size()); -- GitLab