ttan
2016-05-29 14:36:29 UTC
The following snippet does not compile with VS2015 and boost 1.61. What
should the correct way to do it? Thanks.
// compile with cl.exe /EHSc
#define BOOST_TEST_MODULE pair
{
return std::make_pair(0, 0);
}
BOOST_AUTO_TEST_CASE(range)
{
whereas v() returns a variable of the typeshould the correct way to do it? Thanks.
// compile with cl.exe /EHSc
#define BOOST_TEST_MODULE pair
{
return std::make_pair(0, 0);
}
BOOST_AUTO_TEST_CASE(range)
{
BOOST_TEST(std::make_pair(0, 0) == v());
}
}
These are different types and there is no equality operator to compare
them.
the support of std::pair by BOOST_TEST, like below
BOOST_AUTO_TEST_CASE(range)
{
(std::make_pair(uint32_t(0), uint32_t(0)) == v()); // this is OK
BOOST_TEST(std::make_pair(uint32_t(0), uint32_t(0)) == v()); // this not
}
judging from the error, operator << is not support by std::pair in
boost.test. What is the best way, I mean where, to add the support?
C:\3rd\boost_1_61_0\boost/test/tools/detail/print_helper.hpp(47): error
C2338: Type has to implement operator<< to be printable
--
View this message in context: http://boost.2283326.n4.nabble.com/test-how-to-test-std-pair-with-BOOST-TEST-tp4686592p4686595.html
Sent from the Boost - Users mailing list archive at Nabble.com.