diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-07-07 17:21:38 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-07-07 17:21:38 +0200 |
| commit | 9ed28be29dafc97a68098dbf94e29c0599376738 (patch) | |
| tree | d6cbcd79e125f1ea164f4f3bc20e3ec42be8ab45 | |
| parent | fd4942b6f56227e9d90ad046ae011bc9db05eae0 (diff) | |
| download | Project-Tick-9ed28be29dafc97a68098dbf94e29c0599376738.tar.gz Project-Tick-9ed28be29dafc97a68098dbf94e29c0599376738.zip | |
Add tests for value copying
| -rw-r--r-- | test/nbttest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/nbttest.cpp b/test/nbttest.cpp index b8a548aa05..19a9ddc1b9 100644 --- a/test/nbttest.cpp +++ b/test/nbttest.cpp @@ -192,6 +192,18 @@ void test_value() ASSERT(val1.get_type() == tag_type::Int); ASSERT(val2.get_type() == tag_type::Null); ASSERT(val3.get_type() == tag_type::Null); + + val2 = val1; + val1 = val3; + ASSERT(!val1 && val2 && !val3); + ASSERT(val1.get_ptr() == nullptr); + ASSERT(val2.get() == tag_int(21)); + ASSERT(value(val1) == val1); + ASSERT(value(val2) == val2); + val1 = val1; + val2 = val2; + ASSERT(!val1); + ASSERT(val2 == tag_int(21)); std::clog << "test_value passed" << std::endl; } |
