Added BOOST_TEST_ALL_EQ macro to compare container contents

This commit is contained in:
Bjorn Reese
2017-02-11 15:03:45 +01:00
parent 9dd5285dbb
commit 3bc56800cd
3 changed files with 60 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
// http://www.boost.org/LICENSE_1_0.txt
//
#include <vector>
#include <boost/detail/lightweight_test.hpp>
struct X
@@ -74,6 +75,15 @@ int main()
BOOST_TEST_NE("xabc"+1, "yabc"+1); // equal cstrings, different addresses
BOOST_TEST_CSTR_NE("x", "y");
// BOOST_TEST_ALL_EQ
{
std::vector<int> xarray;
xarray.push_back(1);
xarray.push_back(2);
std::vector<int> yarray(xarray);
BOOST_TEST_ALL_EQ(xarray.begin(), xarray.end(), yarray.begin(), yarray.end());
}
// BOOST_TEST_THROWS
BOOST_TEST_THROWS( throw X(), X );