unit test - check values stored as expected types in mapnik::value

This commit is contained in:
artemp 2015-11-03 15:17:43 +00:00
parent 6aca4b17f8
commit a2975c0d23

View file

@ -11,6 +11,10 @@ TEST_CASE("comparison")
mapnik::value v1 = 1.001; // mapnik::value_double
mapnik::value v2 = true; // mapnik::value_boolean
CHECK(v0.is<mapnik::value_integer>());
CHECK(v1.is<mapnik::value_double>());
CHECK(v2.is<mapnik::value_bool>());
REQUIRE(!(v0 == v1));
REQUIRE(!(v1 == v0));
@ -28,6 +32,11 @@ TEST_CASE("comparison")
mapnik::value v2 = true; // mapnik::value_boolean
mapnik::value v3 = mapnik::value_null(); //
CHECK(v0.is<mapnik::value_integer>());
CHECK(v1.is<mapnik::value_double>());
CHECK(v2.is<mapnik::value_bool>());
CHECK(v3.is<mapnik::value_null>());
REQUIRE(v0 != v1);
REQUIRE(v1 != v0);
@ -51,6 +60,11 @@ TEST_CASE("comparison")
mapnik::value v1 = 1.01;
mapnik::value v2 = true;
mapnik::value v3 = 2;
CHECK(v0.is<mapnik::value_integer>());
CHECK(v1.is<mapnik::value_double>());
CHECK(v2.is<mapnik::value_bool>());
CHECK(v3.is<mapnik::value_integer>());
// value_integer | value_double
// 1 < 1.01 => true
// 1.01 > 1 => true