mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-17 11:05:05 +02:00
Support MSVC cli.
MSVC CLI defined their own nullptr and provides for __nullptr for standard C++11. https://msdn.microsoft.com/en-us/library/4ex65770.aspx msgpack-c introduce MSGPACK_NULLPTR for internal use, it is defined as __nullptr only if compiled on C++ CLI otherwise defined as nullptr.
This commit is contained in:
@@ -12,7 +12,7 @@ TEST(limit, unpack_array_no_over)
|
||||
msgpack::pack(ss, v);
|
||||
try {
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(3, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(true);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ TEST(limit, unpack_array_over)
|
||||
msgpack::pack(ss, v);
|
||||
try {
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -56,7 +56,7 @@ TEST(limit, unpack_map_no_over)
|
||||
msgpack::pack(ss, m);
|
||||
try {
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(0, 3, 0, 0, 0));
|
||||
EXPECT_TRUE(true);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ TEST(limit, unpack_map_over)
|
||||
msgpack::pack(ss, m);
|
||||
try {
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(0, 2, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -97,7 +97,7 @@ TEST(limit, unpack_str_no_over)
|
||||
msgpack::pack(ss, s);
|
||||
try {
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(0, 0, 3, 0, 0));
|
||||
EXPECT_TRUE(true);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ TEST(limit, unpack_str_over)
|
||||
msgpack::pack(ss, s);
|
||||
try {
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(0, 0, 2, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -138,7 +138,7 @@ TEST(limit, unpack_bin_no_over)
|
||||
msgpack::pack(ss, v);
|
||||
try {
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(0, 0, 0, 3, 0));
|
||||
EXPECT_TRUE(true);
|
||||
}
|
||||
@@ -160,7 +160,7 @@ TEST(limit, unpack_bin_over)
|
||||
msgpack::pack(ss, v);
|
||||
try {
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(0, 0, 0, 2, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -181,7 +181,7 @@ TEST(limit, unpack_ext_no_over)
|
||||
packer.pack_ext_body(buf, sizeof(buf));
|
||||
try {
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(0, 0, 0, 0, 3+1));
|
||||
EXPECT_TRUE(true);
|
||||
}
|
||||
@@ -202,7 +202,7 @@ TEST(limit, unpack_ext_over)
|
||||
packer.pack_ext_body(buf, sizeof(buf));
|
||||
try {
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(0, 0, 0, 0, 2+1));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -227,7 +227,7 @@ TEST(limit, unpack_ext_over_32_bit)
|
||||
};
|
||||
try {
|
||||
msgpack::object_handle unp;
|
||||
msgpack::unpack(unp, buf, sizeof(buf), nullptr, nullptr,
|
||||
msgpack::unpack(unp, buf, sizeof(buf), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(0, 0, 0, 0, 0xffffffff));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -253,7 +253,7 @@ TEST(limit, unpack_ext_no_over_64_bit)
|
||||
};
|
||||
try {
|
||||
msgpack::object_handle unp;
|
||||
msgpack::unpack(unp, buf, sizeof(buf), nullptr, nullptr,
|
||||
msgpack::unpack(unp, buf, sizeof(buf), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(0, 0, 0, 0, 0xffffffff));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -279,7 +279,7 @@ TEST(limit, unpack_depth_no_over)
|
||||
msgpack::pack(ss, outer);
|
||||
try {
|
||||
msgpack::object_handle unp;
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(1, 0, 0, 0, 0, 2));
|
||||
EXPECT_TRUE(true);
|
||||
}
|
||||
@@ -301,7 +301,7 @@ TEST(limit, unpack_depth_over)
|
||||
msgpack::pack(ss, outer);
|
||||
try {
|
||||
msgpack::object_handle unp;
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(1, 0, 0, 0, 0, 1));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -327,7 +327,7 @@ TEST(limit, unpack_array_over_cpp11_no_off_no_ref)
|
||||
msgpack::pack(ss, v);
|
||||
try {
|
||||
msgpack::object_handle unp =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -350,7 +350,7 @@ TEST(limit, unpack_array_over_cpp11_no_off_ref)
|
||||
try {
|
||||
bool ref;
|
||||
msgpack::object_handle unp =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), ref, nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), ref, MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -373,7 +373,7 @@ TEST(limit, unpack_array_over_cpp11_off_no_ref)
|
||||
try {
|
||||
std::size_t off = 0;
|
||||
msgpack::object_handle unp =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), off, nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), off, MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -397,7 +397,7 @@ TEST(limit, unpack_array_over_cpp11_off_ref)
|
||||
bool ref;
|
||||
std::size_t off = 0;
|
||||
msgpack::object_handle unp =
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), off, ref, nullptr, nullptr,
|
||||
msgpack::unpack(ss.str().c_str(), ss.str().size(), off, ref, MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -421,7 +421,7 @@ TEST(limit, unpack_array_over_no_off_no_ref)
|
||||
msgpack::pack(ss, v);
|
||||
try {
|
||||
msgpack::object_handle unp;
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), nullptr, nullptr,
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -444,7 +444,7 @@ TEST(limit, unpack_array_over_no_off_ref)
|
||||
try {
|
||||
bool ref;
|
||||
msgpack::object_handle unp;
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), ref, nullptr, nullptr,
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), ref, MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -467,7 +467,7 @@ TEST(limit, unpack_array_over_off_no_ref)
|
||||
try {
|
||||
std::size_t off = 0;
|
||||
msgpack::object_handle unp;
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), off, nullptr, nullptr,
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), off, MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -491,7 +491,7 @@ TEST(limit, unpack_array_over_off_ref)
|
||||
bool ref;
|
||||
std::size_t off = 0;
|
||||
msgpack::object_handle unp;
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), off, ref, nullptr, nullptr,
|
||||
msgpack::unpack(unp, ss.str().c_str(), ss.str().size(), off, ref, MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -518,7 +518,7 @@ TEST(limit, unpack_array_over_off_ref_pointer)
|
||||
bool ref;
|
||||
std::size_t off = 0;
|
||||
msgpack::object_handle unp;
|
||||
msgpack::unpack(&unp, ss.str().c_str(), ss.str().size(), &off, &ref, nullptr, nullptr,
|
||||
msgpack::unpack(&unp, ss.str().c_str(), ss.str().size(), &off, &ref, MSGPACK_NULLPTR, MSGPACK_NULLPTR,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
@@ -541,7 +541,7 @@ TEST(limit, unpacker_array_over)
|
||||
v.push_back(3);
|
||||
msgpack::pack(ss, v);
|
||||
try {
|
||||
msgpack::unpacker u(nullptr, nullptr, MSGPACK_UNPACKER_INIT_BUFFER_SIZE,
|
||||
msgpack::unpacker u(MSGPACK_NULLPTR, MSGPACK_NULLPTR, MSGPACK_UNPACKER_INIT_BUFFER_SIZE,
|
||||
msgpack::unpack_limit(2, 0, 0, 0, 0));
|
||||
u.reserve_buffer(ss.str().size());
|
||||
memcpy(u.buffer(), ss.str().c_str(), ss.str().size());
|
||||
@@ -560,7 +560,7 @@ TEST(limit, unpacker_array_over)
|
||||
|
||||
TEST(limit, unpacker_reserve)
|
||||
{
|
||||
msgpack::unpacker u(nullptr, nullptr, MSGPACK_UNPACKER_INIT_BUFFER_SIZE,
|
||||
msgpack::unpacker u(MSGPACK_NULLPTR, MSGPACK_NULLPTR, MSGPACK_UNPACKER_INIT_BUFFER_SIZE,
|
||||
msgpack::unpack_limit());
|
||||
std::size_t original_capacity = u.buffer_capacity();
|
||||
u.reserve_buffer(original_capacity + 1u);
|
||||
@@ -569,7 +569,7 @@ TEST(limit, unpacker_reserve)
|
||||
|
||||
TEST(limit, unpacker_reserve_more_than_twice)
|
||||
{
|
||||
msgpack::unpacker u(nullptr, nullptr, MSGPACK_UNPACKER_INIT_BUFFER_SIZE,
|
||||
msgpack::unpacker u(MSGPACK_NULLPTR, MSGPACK_NULLPTR, MSGPACK_UNPACKER_INIT_BUFFER_SIZE,
|
||||
msgpack::unpack_limit());
|
||||
std::size_t original_capacity = u.buffer_capacity();
|
||||
u.reserve_buffer(original_capacity * 3);
|
||||
|
@@ -170,7 +170,7 @@ TEST(unpack, int_pointer_off_no_ref_explicit)
|
||||
std::size_t off = 0;
|
||||
|
||||
// obsolete
|
||||
msgpack::unpack(&oh, sbuf.data(), sbuf.size(), &off, nullptr);
|
||||
msgpack::unpack(&oh, sbuf.data(), sbuf.size(), &off, MSGPACK_NULLPTR);
|
||||
EXPECT_EQ(1, oh.get().as<int>());
|
||||
EXPECT_EQ(off, sbuf.size());
|
||||
}
|
||||
@@ -183,7 +183,7 @@ TEST(unpack, int_pointer_no_off_ref)
|
||||
bool referenced;
|
||||
|
||||
// obsolete
|
||||
msgpack::unpack(&oh, sbuf.data(), sbuf.size(), nullptr, &referenced);
|
||||
msgpack::unpack(&oh, sbuf.data(), sbuf.size(), MSGPACK_NULLPTR, &referenced);
|
||||
EXPECT_EQ(1, oh.get().as<int>());
|
||||
EXPECT_EQ(false, referenced);
|
||||
}
|
||||
|
@@ -140,12 +140,12 @@ TEST(reference, unpack_int_sized_ref)
|
||||
msgpack::pack(sbuf, 1);
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(sbuf.data(), sbuf.size(), referenced, never_called, &sbuf);
|
||||
EXPECT_FALSE(referenced);
|
||||
EXPECT_EQ(nullptr, s_p);
|
||||
EXPECT_EQ(MSGPACK_NULLPTR, s_p);
|
||||
}
|
||||
|
||||
TEST(reference, unpack_string_sized_ref_4)
|
||||
@@ -154,7 +154,7 @@ TEST(reference, unpack_string_sized_ref_4)
|
||||
msgpack::pack(sbuf, std::string("1234"));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
// the last argument sbuf is any pointer as a user data.
|
||||
// That is stored to s_p in sized_reference
|
||||
msgpack::object_handle oh =
|
||||
@@ -170,7 +170,7 @@ TEST(reference, unpack_string_sized_ref_5)
|
||||
msgpack::pack(sbuf, std::string("12345"));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
@@ -188,7 +188,7 @@ TEST(reference, unpack_bin_sized_ref_5)
|
||||
packer.pack_bin_body(c, sizeof(c));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
@@ -205,7 +205,7 @@ TEST(reference, unpack_bin_sized_ref_6)
|
||||
packer.pack_bin_body(c, sizeof(c));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
EXPECT_TRUE(referenced);
|
||||
@@ -222,7 +222,7 @@ TEST(reference, unpack_ext_sized_ref_6)
|
||||
packer.pack_ext_body(buf, sizeof(buf));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
EXPECT_FALSE(referenced);
|
||||
@@ -239,7 +239,7 @@ TEST(reference, unpack_ext_sized_ref_7)
|
||||
packer.pack_ext_body(buf, sizeof(buf));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
msgpack::object_handle oh =
|
||||
msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
EXPECT_TRUE(referenced);
|
||||
@@ -333,11 +333,11 @@ TEST(reference, unpacker_int_sized_ref)
|
||||
unp.reserve_buffer(sbuf.size());
|
||||
std::memcpy(unp.buffer(), sbuf.data(), sbuf.size());
|
||||
unp.buffer_consumed(sbuf.size());
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
bool b = unp.next(oh, referenced);
|
||||
EXPECT_TRUE(b);
|
||||
EXPECT_FALSE(referenced);
|
||||
EXPECT_EQ(nullptr, s_p);
|
||||
EXPECT_EQ(MSGPACK_NULLPTR, s_p);
|
||||
}
|
||||
|
||||
TEST(reference, unpacker_string_sized_ref_4)
|
||||
@@ -351,7 +351,7 @@ TEST(reference, unpacker_string_sized_ref_4)
|
||||
unp.reserve_buffer(sbuf.size());
|
||||
std::memcpy(unp.buffer(), sbuf.data(), sbuf.size());
|
||||
unp.buffer_consumed(sbuf.size());
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
bool b = unp.next(oh, referenced);
|
||||
EXPECT_TRUE(b);
|
||||
EXPECT_FALSE(referenced);
|
||||
@@ -369,7 +369,7 @@ TEST(reference, unpacker_string_sized_ref_5)
|
||||
unp.reserve_buffer(sbuf.size());
|
||||
std::memcpy(unp.buffer(), sbuf.data(), sbuf.size());
|
||||
unp.buffer_consumed(sbuf.size());
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
bool b = unp.next(oh, referenced);
|
||||
EXPECT_TRUE(b);
|
||||
EXPECT_TRUE(referenced);
|
||||
@@ -391,7 +391,7 @@ TEST(reference, unpacker_bin_sized_ref_5)
|
||||
unp.reserve_buffer(sbuf.size());
|
||||
std::memcpy(unp.buffer(), sbuf.data(), sbuf.size());
|
||||
unp.buffer_consumed(sbuf.size());
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
bool b = unp.next(oh, referenced);
|
||||
EXPECT_TRUE(b);
|
||||
EXPECT_FALSE(referenced);
|
||||
@@ -412,7 +412,7 @@ TEST(reference, unpacker_bin_sized_ref_6)
|
||||
unp.reserve_buffer(sbuf.size());
|
||||
std::memcpy(unp.buffer(), sbuf.data(), sbuf.size());
|
||||
unp.buffer_consumed(sbuf.size());
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
bool b = unp.next(oh, referenced);
|
||||
EXPECT_TRUE(b);
|
||||
EXPECT_TRUE(referenced);
|
||||
@@ -434,7 +434,7 @@ TEST(reference, unpacker_ext_sized_ref_6)
|
||||
unp.reserve_buffer(sbuf.size());
|
||||
std::memcpy(unp.buffer(), sbuf.data(), sbuf.size());
|
||||
unp.buffer_consumed(sbuf.size());
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
bool b = unp.next(oh, referenced);
|
||||
EXPECT_TRUE(b);
|
||||
EXPECT_FALSE(referenced);
|
||||
@@ -456,7 +456,7 @@ TEST(reference, unpacker_ext_sized_ref_7)
|
||||
unp.reserve_buffer(sbuf.size());
|
||||
std::memcpy(unp.buffer(), sbuf.data(), sbuf.size());
|
||||
unp.buffer_consumed(sbuf.size());
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
bool b = unp.next(oh, referenced);
|
||||
EXPECT_TRUE(b);
|
||||
EXPECT_TRUE(referenced);
|
||||
|
@@ -133,10 +133,10 @@ TEST(reference, unpack_int_sized_ref)
|
||||
msgpack::pack(sbuf, 1);
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
msgpack::object_handle oh = msgpack::unpack(sbuf.data(), sbuf.size(), referenced, never_called, &sbuf);
|
||||
EXPECT_FALSE(referenced);
|
||||
EXPECT_EQ(nullptr, s_p);
|
||||
EXPECT_EQ(MSGPACK_NULLPTR, s_p);
|
||||
}
|
||||
|
||||
TEST(reference, unpack_string_sized_ref_4)
|
||||
@@ -145,7 +145,7 @@ TEST(reference, unpack_string_sized_ref_4)
|
||||
msgpack::pack(sbuf, std::string("1234"));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
// the last argument sbuf is any pointer as a user data.
|
||||
// That is stored to s_p in sized_reference
|
||||
msgpack::object_handle oh = msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
@@ -160,7 +160,7 @@ TEST(reference, unpack_string_sized_ref_5)
|
||||
msgpack::pack(sbuf, std::string("12345"));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
msgpack::object_handle oh = msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
EXPECT_TRUE(referenced);
|
||||
EXPECT_EQ(&sbuf, s_p);
|
||||
@@ -176,7 +176,7 @@ TEST(reference, unpack_bin_sized_ref_5)
|
||||
packer.pack_bin_body(c, sizeof(c));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
msgpack::object_handle oh = msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
EXPECT_FALSE(referenced);
|
||||
EXPECT_EQ(&sbuf, s_p);
|
||||
@@ -191,7 +191,7 @@ TEST(reference, unpack_bin_sized_ref_6)
|
||||
packer.pack_bin_body(c, sizeof(c));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
msgpack::object_handle oh = msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
EXPECT_TRUE(referenced);
|
||||
EXPECT_EQ(&sbuf, s_p);
|
||||
@@ -207,7 +207,7 @@ TEST(reference, unpack_ext_sized_ref_6)
|
||||
packer.pack_ext_body(buf, sizeof(buf));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
msgpack::object_handle oh = msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
EXPECT_FALSE(referenced);
|
||||
EXPECT_EQ(&sbuf, s_p);
|
||||
@@ -223,7 +223,7 @@ TEST(reference, unpack_ext_sized_ref_7)
|
||||
packer.pack_ext_body(buf, sizeof(buf));
|
||||
|
||||
bool referenced;
|
||||
s_p = nullptr;
|
||||
s_p = MSGPACK_NULLPTR;
|
||||
msgpack::object_handle oh = msgpack::unpack(sbuf.data(), sbuf.size(), referenced, sized_reference, &sbuf);
|
||||
EXPECT_TRUE(referenced);
|
||||
EXPECT_EQ(&sbuf, s_p);
|
||||
|
Reference in New Issue
Block a user