Fixed warnings on build with CMAKE_BUILD_TYPE=Release.

Added stream outputs to suppress warnings and to help understanding.
This commit is contained in:
Takatoshi Kondo
2015-09-01 11:06:29 +09:00
parent 9b156823ff
commit be0f8c280a
3 changed files with 66 additions and 13 deletions

View File

@@ -40,8 +40,11 @@ int main() {
// msgpack array is constructed on z.
msgpack::object obj = msgpack::unpack(z, ss.str().data(), ss.str().size(), offset);
std::cout << obj << std::endl;
assert(obj.as<std::vector<int> >() == v);
// msgpack str is constructed on z.
assert(msgpack::unpack(z, ss.str().data(), ss.str().size(), offset).as<std::string>() == s);
std::string const& str = msgpack::unpack(z, ss.str().data(), ss.str().size(), offset).as<std::string>();
std::cout << str << std::endl;
assert(str == s);
}