changeset 666:66015e773085

json_util: use explicit int
author David Demelier <markand@malikania.fr>
date Thu, 19 Sep 2019 11:34:54 +0000
parents 4a59972e5eb8
children 325be9bbc68f
files cpp/json_util/test/main.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cpp/json_util/test/main.cpp	Thu Sep 19 11:34:32 2019 +0000
+++ b/cpp/json_util/test/main.cpp	Thu Sep 19 11:34:54 2019 +0000
@@ -28,6 +28,7 @@
 	deserializer document_{
 		{ "boolean",    true    },
 		{ "int",        -1234   },
+		{ "int2",       1234    },
 		{ "uint",       1234U   },
 		{ "string",     "str"   }
 	};
@@ -174,6 +175,7 @@
 BOOST_AUTO_TEST_CASE(integer)
 {
 	BOOST_TEST(document_.get_or<int>("int", 3320) == -1234);
+	BOOST_TEST(document_.get_or<int>("int2", 3320) == 1234);
 	BOOST_TEST(document_.get_or<int>("boolean", 3320) == 3320);
 	BOOST_TEST(document_.get_or<int>("undefined", 3320) == 3320);
 }