Files
msgpack/test/Makefile.am
Takatoshi Kondo 309e96087a - Added unpack limit.
- Added new exceptions to explain limit over errors.

- Fixed ext maximum size problem.
Problem:
The type of m_trail was uint32_t but when parsing ext, it could be 0xffffffff + 1. +1 means type. See https://github.com/msgpack/msgpack/blob/master/spec.md#ext-format-family

Solution:
Modified the type of m_trail as std::size_t. If sizeof(std::size_t) == 4, 0xffffffff size of ext is an error. If sizeof(std::size_t) == 8, 0xffffffff size of ext is not an error. m_trail is 0xffffffff + 1.

Design cohice:
I chose std::size_t as the m_trail's type instead of uint64_t intentionally. On 64 addressing bit environment, there is no problem. On 32 bit environment, there is no problem except ext with maximum size. There is only one exception in the all msgpack format. Using uint64_t to support that, it's very expensive. On 32 addressing bit environment, allocating 0xffffffff + 1 bytes of memory couldn't succeed, so I believe that throwing an exception is a reasonable design choice in the case.
2014-12-14 19:10:46 +09:00

80 lines
1.4 KiB
Makefile

AM_CPPFLAGS = -I$(top_srcdir)/include
AM_C_CPPFLAGS = -I$(top_srcdir)/include
AM_LDFLAGS = $(top_builddir)/src/libmsgpack.la -lgtest_main -lgtest -pthread
check_PROGRAMS = \
zone \
pack_unpack \
pack_unpack_c \
streaming \
streaming_c \
object \
object_with_zone \
convert \
buffer \
cases \
fixint \
fixint_c \
version \
msgpack_tuple \
msgpack_c \
msgpack_basic \
msgpack_container \
msgpack_stream \
msgpack_vref \
msgpack_cpp11 \
reference_cpp11 \
reference \
limit
TESTS = $(check_PROGRAMS)
zone_SOURCES = zone.cpp
pack_unpack_SOURCES = pack_unpack.cpp
pack_unpack_c_SOURCES = pack_unpack_c.cpp
streaming_SOURCES = streaming.cpp
streaming_c_SOURCES = streaming_c.cpp
object_SOURCES = object.cpp
object_with_zone_SOURCES = object_with_zone.cpp
convert_SOURCES = convert.cpp
buffer_SOURCES = buffer.cpp
buffer_LDADD = -lz
cases_SOURCES = cases.cpp
fixint_SOURCES = fixint.cpp
fixint_c_SOURCES = fixint_c.cpp
version_SOURCES = version.cpp
msgpack_tuple_SOURCES = msgpack_tuple.cpp
msgpack_c_SOURCES = msgpack_c.cpp
msgpack_basic_SOURCES = msgpack_basic.cpp
msgpack_container_SOURCES = msgpack_container.cpp
msgpack_stream_SOURCES = msgpack_stream.cpp
msgpack_vref_SOURCES = msgpack_vref.cpp
msgpack_cpp11_SOURCES = msgpack_cpp11.cpp
reference_SOURCES = reference.cpp
reference_cpp11_SOURCES = reference_cpp11.cpp
limit_SOURCES = limit.cpp
EXTRA_DIST = cases.mpac cases_compact.mpac