mirror of
https://github.com/boostorg/core.git
synced 2025-11-29 22:00:17 +01:00
Added BOOST_TEST_ALL_EQ macro to compare container contents
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user