Replaced msgpack::unpacked with msgpack::object_handle.

msgpack::unpacked is a typedef of the msgpack::object_handle.
I recommend using msgpack::object_handle. It can be used not only
holding unpacked msgpack objects but also msgpack::objects that are
created by any types.

Replaced unpack() APIs in test codes and examples. They used to use old
APIs.
This commit is contained in:
Takatoshi Kondo
2016-03-21 15:22:50 +09:00
parent 85164687f3
commit 1bfcf55469
43 changed files with 2357 additions and 2359 deletions

View File

@@ -15,7 +15,7 @@ TEST(streaming, basic)
const char* const eof = input + buffer.size();
msgpack::unpacker pac;
msgpack::unpacked result;
msgpack::object_handle oh;
int count = 0;
while(count < 3) {
@@ -29,8 +29,8 @@ TEST(streaming, basic)
pac.buffer_consumed(len);
while(pac.next(result)) {
msgpack::object obj = result.get();
while(pac.next(oh)) {
msgpack::object obj = oh.get();
switch(count++) {
case 0:
EXPECT_EQ(1, obj.as<int>());
@@ -61,7 +61,7 @@ TEST(streaming, basic_pointer)
const char* const eof = input + buffer.size();
msgpack::unpacker pac;
msgpack::unpacked result;
msgpack::object_handle oh;
int count = 0;
while(count < 3) {
@@ -75,8 +75,8 @@ TEST(streaming, basic_pointer)
pac.buffer_consumed(len);
while(pac.next(&result)) {
msgpack::object obj = result.get();
while(pac.next(&oh)) {
msgpack::object obj = oh.get();
switch(count++) {
case 0:
EXPECT_EQ(1, obj.as<int>());
@@ -109,7 +109,7 @@ TEST(streaming, move)
const char* const eof = input + buffer.size();
msgpack::unpacker pac;
msgpack::unpacked result;
msgpack::object_handle oh;
int count = 0;
while(count < 3) {
@@ -124,8 +124,8 @@ TEST(streaming, move)
pac_in.buffer_consumed(len);
while(pac_in.next(result)) {
msgpack::object obj = result.get();
while(pac_in.next(oh)) {
msgpack::object obj = oh.get();
switch(count++) {
case 0:
EXPECT_EQ(1, obj.as<int>());
@@ -164,9 +164,9 @@ public:
pac.buffer_consumed(len);
msgpack::unpacked result;
while(pac.next(result)) {
on_message(result.get(), msgpack::move(result.zone()));
msgpack::object_handle oh;
while(pac.next(oh)) {
on_message(oh.get(), msgpack::move(oh.zone()));
}
if(pac.message_size() > 10*1024*1024) {