diff options
author | 2016-04-27 18:00:54 +0200 | |
---|---|---|
committer | 2016-04-27 18:00:54 +0200 | |
commit | 7b9f4e41b93dac0ddca9dd449da79b0416a27d14 (patch) | |
tree | d807ae5a46f065017e36a8e7309991a85c3af584 /3rdparty/rapidjson/test/unittest/documenttest.cpp | |
parent | 94c7dd996bfb9123425c87f2d149018d371dded7 (diff) |
Updated rapidjson (nw)
Diffstat (limited to '3rdparty/rapidjson/test/unittest/documenttest.cpp')
-rw-r--r-- | 3rdparty/rapidjson/test/unittest/documenttest.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/3rdparty/rapidjson/test/unittest/documenttest.cpp b/3rdparty/rapidjson/test/unittest/documenttest.cpp index 0c9ffaba442..ecd4b79bc2a 100644 --- a/3rdparty/rapidjson/test/unittest/documenttest.cpp +++ b/3rdparty/rapidjson/test/unittest/documenttest.cpp @@ -447,10 +447,10 @@ TYPED_TEST_CASE(DocumentMove, MoveAllocatorTypes); TYPED_TEST(DocumentMove, MoveConstructor) { typedef TypeParam Allocator; - typedef GenericDocument<UTF8<>, Allocator> Document; + typedef GenericDocument<UTF8<>, Allocator> D; Allocator allocator; - Document a(&allocator); + D a(&allocator); a.Parse("[\"one\", \"two\", \"three\"]"); EXPECT_FALSE(a.HasParseError()); EXPECT_TRUE(a.IsArray()); @@ -458,7 +458,7 @@ TYPED_TEST(DocumentMove, MoveConstructor) { EXPECT_EQ(&a.GetAllocator(), &allocator); // Document b(a); // does not compile (!is_copy_constructible) - Document b(std::move(a)); + D b(std::move(a)); EXPECT_TRUE(a.IsNull()); EXPECT_TRUE(b.IsArray()); EXPECT_EQ(3u, b.Size()); @@ -471,7 +471,7 @@ TYPED_TEST(DocumentMove, MoveConstructor) { EXPECT_EQ(2u, b.MemberCount()); // Document c = a; // does not compile (!is_copy_constructible) - Document c = std::move(b); + D c = std::move(b); EXPECT_TRUE(b.IsNull()); EXPECT_TRUE(c.IsObject()); EXPECT_EQ(2u, c.MemberCount()); @@ -481,17 +481,17 @@ TYPED_TEST(DocumentMove, MoveConstructor) { TYPED_TEST(DocumentMove, MoveConstructorParseError) { typedef TypeParam Allocator; - typedef GenericDocument<UTF8<>, Allocator> Document; + typedef GenericDocument<UTF8<>, Allocator> D; ParseResult noError; - Document a; + D a; a.Parse("{ 4 = 4]"); ParseResult error(a.GetParseError(), a.GetErrorOffset()); EXPECT_TRUE(a.HasParseError()); EXPECT_NE(error.Code(), noError.Code()); EXPECT_NE(error.Offset(), noError.Offset()); - Document b(std::move(a)); + D b(std::move(a)); EXPECT_FALSE(a.HasParseError()); EXPECT_TRUE(b.HasParseError()); EXPECT_EQ(a.GetParseError(), noError.Code()); @@ -499,7 +499,7 @@ TYPED_TEST(DocumentMove, MoveConstructorParseError) { EXPECT_EQ(a.GetErrorOffset(), noError.Offset()); EXPECT_EQ(b.GetErrorOffset(), error.Offset()); - Document c(std::move(b)); + D c(std::move(b)); EXPECT_FALSE(b.HasParseError()); EXPECT_TRUE(c.HasParseError()); EXPECT_EQ(b.GetParseError(), noError.Code()); @@ -540,10 +540,10 @@ TYPED_TEST(DocumentMove, MoveConstructorStack) { TYPED_TEST(DocumentMove, MoveAssignment) { typedef TypeParam Allocator; - typedef GenericDocument<UTF8<>, Allocator> Document; + typedef GenericDocument<UTF8<>, Allocator> D; Allocator allocator; - Document a(&allocator); + D a(&allocator); a.Parse("[\"one\", \"two\", \"three\"]"); EXPECT_FALSE(a.HasParseError()); EXPECT_TRUE(a.IsArray()); @@ -551,7 +551,7 @@ TYPED_TEST(DocumentMove, MoveAssignment) { EXPECT_EQ(&a.GetAllocator(), &allocator); // Document b; b = a; // does not compile (!is_copy_assignable) - Document b; + D b; b = std::move(a); EXPECT_TRUE(a.IsNull()); EXPECT_TRUE(b.IsArray()); @@ -565,7 +565,7 @@ TYPED_TEST(DocumentMove, MoveAssignment) { EXPECT_EQ(2u, b.MemberCount()); // Document c; c = a; // does not compile (see static_assert) - Document c; + D c; c = std::move(b); EXPECT_TRUE(b.IsNull()); EXPECT_TRUE(c.IsObject()); @@ -576,17 +576,17 @@ TYPED_TEST(DocumentMove, MoveAssignment) { TYPED_TEST(DocumentMove, MoveAssignmentParseError) { typedef TypeParam Allocator; - typedef GenericDocument<UTF8<>, Allocator> Document; + typedef GenericDocument<UTF8<>, Allocator> D; ParseResult noError; - Document a; + D a; a.Parse("{ 4 = 4]"); ParseResult error(a.GetParseError(), a.GetErrorOffset()); EXPECT_TRUE(a.HasParseError()); EXPECT_NE(error.Code(), noError.Code()); EXPECT_NE(error.Offset(), noError.Offset()); - Document b; + D b; b = std::move(a); EXPECT_FALSE(a.HasParseError()); EXPECT_TRUE(b.HasParseError()); @@ -595,7 +595,7 @@ TYPED_TEST(DocumentMove, MoveAssignmentParseError) { EXPECT_EQ(a.GetErrorOffset(), noError.Offset()); EXPECT_EQ(b.GetErrorOffset(), error.Offset()); - Document c; + D c; c = std::move(b); EXPECT_FALSE(b.HasParseError()); EXPECT_TRUE(c.HasParseError()); @@ -612,9 +612,9 @@ TYPED_TEST(DocumentMove, MoveAssignmentParseError) { TYPED_TEST(DocumentMove, MoveAssignmentStack) { typedef TypeParam Allocator; typedef UTF8<> Encoding; - typedef GenericDocument<Encoding, Allocator> Document; + typedef GenericDocument<Encoding, Allocator> D; - Document a; + D a; size_t defaultCapacity = a.GetStackCapacity(); // Trick Document into getting GetStackCapacity() to return non-zero @@ -625,12 +625,12 @@ TYPED_TEST(DocumentMove, MoveAssignmentStack) { size_t capacity = a.GetStackCapacity(); EXPECT_GT(capacity, 0u); - Document b; + D b; b = std::move(a); EXPECT_EQ(a.GetStackCapacity(), defaultCapacity); EXPECT_EQ(b.GetStackCapacity(), capacity); - Document c; + D c; c = std::move(b); EXPECT_EQ(b.GetStackCapacity(), defaultCapacity); EXPECT_EQ(c.GetStackCapacity(), capacity); |