mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-06-25 22:15:23 +02:00
Merge branch 'jamessan-cxx11-32bit'
This commit is contained in:
commit
7918c19f8f
@ -1,4 +1,4 @@
|
||||
IF (MSGPACK_CXX11)
|
||||
IF (MSGPACK_CXX11 OR MSGPACK_CXX17)
|
||||
INCLUDE_DIRECTORIES (
|
||||
../include
|
||||
)
|
||||
|
@ -55,7 +55,7 @@ IF (MSGPACK_USE_X3_PARSE)
|
||||
)
|
||||
ENDIF ()
|
||||
|
||||
IF (MSGPACK_CXX11)
|
||||
IF (MSGPACK_CXX11 OR MSGPACK_CXX17)
|
||||
LIST (APPEND check_PROGRAMS
|
||||
iterator_cpp11.cpp
|
||||
msgpack_cpp11.cpp
|
||||
|
@ -1082,7 +1082,7 @@ TEST(MSGPACK_TIMESPEC, timespec_object_with_zone_zero)
|
||||
TEST(MSGPACK_TIMESPEC, timespec_pack_convert_32bit_sec)
|
||||
{
|
||||
std::stringstream ss;
|
||||
timespec val1{ 0xffffffffUL, 0 };
|
||||
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::is_signed ? INT32_MAX : UINT32_MAX, 0 };
|
||||
|
||||
msgpack::pack(ss, val1);
|
||||
std::string const& str = ss.str();
|
||||
@ -1098,7 +1098,7 @@ TEST(MSGPACK_TIMESPEC, timespec_pack_convert_32bit_sec)
|
||||
TEST(MSGPACK_TIMESPEC, timespec_object_with_zone_32bit_sec)
|
||||
{
|
||||
msgpack::zone z;
|
||||
timespec val1{ 0xffffffffUL, 0 };
|
||||
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::is_signed ? INT32_MAX : UINT32_MAX, 0 };
|
||||
msgpack::object obj(val1, z);
|
||||
timespec val2 = obj.as<timespec>();
|
||||
EXPECT_EQ(val1.tv_sec, val2.tv_sec);
|
||||
@ -1188,6 +1188,7 @@ TEST(MSGPACK_TIMESPEC, timespec_object_with_zone_35bit_sec_max_nano)
|
||||
|
||||
TEST(MSGPACK_TIMESPEC, timespec_pack_convert_64bit_sec_max_nano)
|
||||
{
|
||||
if (sizeof(decltype(std::declval<timespec>().tv_sec)) <= 4) return;
|
||||
std::stringstream ss;
|
||||
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::max(), 999999999 };
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user