mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-20 22:31:33 +02:00
Restored the test cases using pointer based interfaces.
It assures that we can use the same interfaces as the original version(0.5.6). To support both C++03 and C++11, I introduced msgpack::unique_ptr and msgpack::move() in test codes.
This commit is contained in:
@@ -37,11 +37,11 @@ TEST(object, convert)
|
||||
msgpack::object obj;
|
||||
|
||||
msgpack::unpack_return ret =
|
||||
msgpack::unpack(sbuf.data(), sbuf.size(), NULL, z, obj);
|
||||
msgpack::unpack(sbuf.data(), sbuf.size(), NULL, &z, &obj);
|
||||
EXPECT_EQ(ret, msgpack::UNPACK_SUCCESS);
|
||||
|
||||
myclass m2;
|
||||
obj.convert(m2);
|
||||
obj.convert(&m2);
|
||||
|
||||
EXPECT_EQ(m1, m2);
|
||||
}
|
||||
@@ -58,7 +58,7 @@ TEST(object, as)
|
||||
msgpack::object obj;
|
||||
|
||||
msgpack::unpack_return ret =
|
||||
msgpack::unpack(sbuf.data(), sbuf.size(), NULL, z, obj);
|
||||
msgpack::unpack(sbuf.data(), sbuf.size(), NULL, &z, &obj);
|
||||
EXPECT_EQ(ret, msgpack::UNPACK_SUCCESS);
|
||||
|
||||
EXPECT_EQ(m1, obj.as<myclass>());
|
||||
|
Reference in New Issue
Block a user