From 401087dfca03d9641cd3b62b004496e38246ae2f Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Sun, 28 Jun 2015 17:30:02 +0200 Subject: Revise test_tag_compound regarding comparison --- test/nbttest.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'test') diff --git a/test/nbttest.cpp b/test/nbttest.cpp index a596259050..8b4329d64f 100644 --- a/test/nbttest.cpp +++ b/test/nbttest.cpp @@ -85,26 +85,19 @@ void test_tag_compound() }*/; ASSERT(comp["foo"].get_type() == tag_type::Short); - ASSERT((int)comp["foo"] == 12); - ASSERT((int16_t)comp["foo"] == int16_t(12)); - /*ASSERT(comp["foo"] == int8_t(12)); - ASSERT(comp["foo"] == 12); - ASSERT(comp["foo"] != "12");*/ + ASSERT(int(comp["foo"]) == 12); + ASSERT(int16_t(comp["foo"]) == int16_t(12)); ASSERT(comp["bar"].get_type() == tag_type::String); - ASSERT((std::string)comp["bar"] == "baz"); - /*ASSERT(comp["bar"] == "baz"); - ASSERT(comp["bar"] != 0);*/ + ASSERT(std::string(comp["bar"]) == "baz"); ASSERT(comp["baz"].get_type() == tag_type::Double); - ASSERT((double)comp["baz"] == -2.0); - /*ASSERT(comp["baz"] == -2.0f); - ASSERT(comp["baz"] == -2); - ASSERT(comp["baz"] != "-2");*/ + ASSERT(double(comp["baz"]) == -2.0); + ASSERT(float(comp["baz"]) == -2.0f); comp["quux"] = tag_compound{/*{"Hello", "World"}, {"zero", 0}*/}; ASSERT(comp["quux"].get_type() == tag_type::Compound); - ASSERT((std::string)comp["quux"]["Hello"] == "World"); + ASSERT(std::string(comp["quux"]["Hello"]) == "World"); tag_compound comp2/*{ {"foo", int16_t(12)}, -- cgit 0.0.5-2-1-g0f52