Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormiloyip <miloyip@gmail.com>2014-07-31 14:53:17 +0400
committermiloyip <miloyip@gmail.com>2014-07-31 14:53:17 +0400
commit9ab2621e855a9abb8377520b42d6dfddcd49a8e1 (patch)
tree0f7a2c73b5fd951a583cf30979fe9b1b42605430 /test
parent71c8402549136ff12a20c040ba8b336c960a906c (diff)
Add Erase(ConstValueIterator) and Erase(ConstValueIterator,ConstValueIterator)
As std::vector::erase() overloads added in C++11
Diffstat (limited to 'test')
-rw-r--r--test/unittest/valuetest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/unittest/valuetest.cpp b/test/unittest/valuetest.cpp
index 3bd0afcf..46f9a59a 100644
--- a/test/unittest/valuetest.cpp
+++ b/test/unittest/valuetest.cpp
@@ -628,11 +628,11 @@ TEST(Value, Array) {
x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);
// Erase the first
- itr = x.Erase(x.Begin());
- EXPECT_EQ(x.Begin(), itr);
- EXPECT_EQ(9u, x.Size());
+ itr = x.Erase(y.Begin()); // const iteator is also OK
+ EXPECT_EQ(y.Begin(), itr);
+ EXPECT_EQ(9u, y.Size());
for (int i = 0; i < 9; i++)
- EXPECT_EQ(i + 1, x[i][0u].GetInt());
+ EXPECT_EQ(i + 1, y[i][0u].GetInt());
// Ease the last
itr = x.Erase(x.End() - 1);
@@ -659,7 +659,7 @@ TEST(Value, Array) {
for (unsigned i = 0; i < n; i++)
x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);
- itr = x.Erase(x.Begin() + first, x.Begin() + last);
+ itr = x.Erase(y.Begin() + first, y.Begin() + last); // const iterator is also OK
if (last == n)
EXPECT_EQ(x.End(), itr);
else