summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-06-28 17:30:02 +0200
committerljfa-ag <ljfa-ag@web.de>2015-06-28 17:30:02 +0200
commit401087dfca03d9641cd3b62b004496e38246ae2f (patch)
tree37a1b6624e29a01f399149a12cb77dfb55270ac8
parent87b3d6c2e151297860d039d614b36cc98238f47a (diff)
downloadProject-Tick-401087dfca03d9641cd3b62b004496e38246ae2f.tar.gz
Project-Tick-401087dfca03d9641cd3b62b004496e38246ae2f.zip
Revise test_tag_compound regarding comparison
-rw-r--r--test/nbttest.cpp19
1 files changed, 6 insertions, 13 deletions
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)},