From: Francis Dupont Date: Wed, 2 Jun 2021 16:21:36 +0000 (+0200) Subject: [(no branch, rebasing 1897-add-d2-server-hook-syntax)] [#1897] Fixed D2GetConfigTest... X-Git-Tag: Kea-1.9.9~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c19217bd06e291bd768d2832c8a201311974313;p=thirdparty%2Fkea.git [(no branch, rebasing 1897-add-d2-server-hook-syntax)] [#1897] Fixed D2GetConfigTest (copied from CA) --- diff --git a/src/bin/d2/tests/get_config_unittest.cc b/src/bin/d2/tests/get_config_unittest.cc index a0d2c28d9d..74c152447e 100644 --- a/src/bin/d2/tests/get_config_unittest.cc +++ b/src/bin/d2/tests/get_config_unittest.cc @@ -273,10 +273,11 @@ TEST_F(D2GetConfigTest, sample1) { // check that unparsed and expected values match EXPECT_TRUE(isEquivalent(unparsed, jsonj)); // check on pretty prints too - std::string current = prettyPrint(unparsed, 0, 4) + "\n"; - EXPECT_EQ(expected, current); - if (expected != current) { - expected = current; + std::string current = prettyPrint(unparsed, 0, 4); + std::string expected2 = prettyPrint(jsonj, 0, 4); + EXPECT_EQ(expected2, current); + if (expected2 != current) { + expected = current + "\n"; } }