From 66014eebc083b352ec4fad6995e0f102b334d536 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 4 Aug 2014 01:08:05 +0900 Subject: [PATCH] Updated test codes using recommended interface. They used to use obsolete interfaces. --- test/msgpack_test.cpp | 9 +++------ test/streaming.cc | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/test/msgpack_test.cpp b/test/msgpack_test.cpp index affe6f7f..e678385f 100644 --- a/test/msgpack_test.cpp +++ b/test/msgpack_test.cpp @@ -1017,17 +1017,14 @@ TEST(MSGPACK, vrefbuffer_int64) pac.reserve_buffer(sz); \ memcpy(pac.buffer(), p, sz); \ pac.buffer_consumed(sz); \ - while (pac.execute()) { \ + msgpack::unpacked result; \ + while (pac.next(result)) { \ if (it == vec.end()) goto out; \ - msgpack::object obj = pac.data(); \ - msgpack::zone *life = pac.release_zone(); \ - EXPECT_TRUE(life != NULL); \ - pac.reset(); \ + msgpack::object obj = result.get(); \ vec_type::value_type val; \ obj.convert(&val); \ EXPECT_EQ(*it, val); \ ++it; \ - msgpack::zone::destroy(life); \ } \ p += sz; \ } \ diff --git a/test/streaming.cc b/test/streaming.cc index 4ecd2f60..2daa98a1 100644 --- a/test/streaming.cc +++ b/test/streaming.cc @@ -124,7 +124,7 @@ TEST(streaming, move) pac_in.buffer_consumed(len); - while(pac_in.next(&result)) { + while(pac_in.next(result)) { msgpack::object obj = result.get(); switch(count++) { case 0: @@ -165,7 +165,7 @@ public: pac.buffer_consumed(len); msgpack::unpacked result; - while(pac.next(&result)) { + while(pac.next(result)) { on_message(result.get(), msgpack::move(result.zone())); }