mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-18 11:39:02 +02:00
Updated test codes using recommended interface.
They used to use obsolete interfaces.
This commit is contained in:
@@ -1017,17 +1017,14 @@ TEST(MSGPACK, vrefbuffer_int64)
|
|||||||
pac.reserve_buffer(sz); \
|
pac.reserve_buffer(sz); \
|
||||||
memcpy(pac.buffer(), p, sz); \
|
memcpy(pac.buffer(), p, sz); \
|
||||||
pac.buffer_consumed(sz); \
|
pac.buffer_consumed(sz); \
|
||||||
while (pac.execute()) { \
|
msgpack::unpacked result; \
|
||||||
|
while (pac.next(result)) { \
|
||||||
if (it == vec.end()) goto out; \
|
if (it == vec.end()) goto out; \
|
||||||
msgpack::object obj = pac.data(); \
|
msgpack::object obj = result.get(); \
|
||||||
msgpack::zone *life = pac.release_zone(); \
|
|
||||||
EXPECT_TRUE(life != NULL); \
|
|
||||||
pac.reset(); \
|
|
||||||
vec_type::value_type val; \
|
vec_type::value_type val; \
|
||||||
obj.convert(&val); \
|
obj.convert(&val); \
|
||||||
EXPECT_EQ(*it, val); \
|
EXPECT_EQ(*it, val); \
|
||||||
++it; \
|
++it; \
|
||||||
msgpack::zone::destroy(life); \
|
|
||||||
} \
|
} \
|
||||||
p += sz; \
|
p += sz; \
|
||||||
} \
|
} \
|
||||||
|
@@ -124,7 +124,7 @@ TEST(streaming, move)
|
|||||||
|
|
||||||
pac_in.buffer_consumed(len);
|
pac_in.buffer_consumed(len);
|
||||||
|
|
||||||
while(pac_in.next(&result)) {
|
while(pac_in.next(result)) {
|
||||||
msgpack::object obj = result.get();
|
msgpack::object obj = result.get();
|
||||||
switch(count++) {
|
switch(count++) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -165,7 +165,7 @@ public:
|
|||||||
pac.buffer_consumed(len);
|
pac.buffer_consumed(len);
|
||||||
|
|
||||||
msgpack::unpacked result;
|
msgpack::unpacked result;
|
||||||
while(pac.next(&result)) {
|
while(pac.next(result)) {
|
||||||
on_message(result.get(), msgpack::move(result.zone()));
|
on_message(result.get(), msgpack::move(result.zone()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user