Add more 'RemoveIfKeepValid' tests.

This commit is contained in:
vng 2011-10-17 21:57:37 +03:00 committed by Alex Zolotarev
parent a1d59a2e67
commit 500cb74fbd

View file

@ -1,7 +1,12 @@
#include "../../testing/testing.hpp"
#include "../macros.hpp"
#include "../stl_add.hpp"
#include "../../std/deque.hpp"
UNIT_TEST(STLAdd_IsSorted)
{
TEST(IsSorted(static_cast<int*>(0), static_cast<int*>(0)), ());
@ -66,4 +71,17 @@ UNIT_TEST(STLAdd_RemoveIfKeepValid)
CheckNoZero(v, RemoveIfKeepValid(v.begin(), v.end(), EqualZero()));
TEST_EQUAL(v.size(), 4, ());
}
{
deque<int> v;
v.push_back(1);
v.push_back(0);
v.push_back(1);
v.push_back(0);
v.push_back(1);
v.push_back(0);
v.push_back(1);
CheckNoZero(v, RemoveIfKeepValid(v.begin(), v.end(), EqualZero()));
TEST_EQUAL(v.size(), 4, ());
}
}