10template <
typename T> std::pair<T, T> msgpack_roundtrip(
const T&
object)
13 msgpack::sbuffer buffer;
14 msgpack::pack(buffer,
object);
15 msgpack::unpack(buffer.data(), buffer.size()).get().convert(result);
16 return { object, result };
19template <
typename T>
inline T call_msgpack_cbind(
auto cbind_func,
auto... test_args)
21 auto [input, input_len] = msgpack_encode_buffer(std::make_tuple(test_args...));
24 cbind_func(input, input_len, &output, &output_len);
26 msgpack::unpack((
const char*)output, output_len).get().convert(actual_ret);
33inline auto call_func_and_wrapper(
auto func,
auto cbind_func,
auto... test_args)
35 auto expected_ret = func(test_args...);
36 auto actual_ret = call_msgpack_cbind<decltype(expected_ret)>(cbind_func, test_args...);
37 return std::make_pair(actual_ret, expected_ret);