mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-11-07 14:37:39 +01:00
@@ -475,7 +475,9 @@ TEST(Pointer, CopyConstructor) {
|
||||
EXPECT_EQ(1u, q.GetTokens()[1].length);
|
||||
EXPECT_STREQ("0", q.GetTokens()[1].name);
|
||||
EXPECT_EQ(0u, q.GetTokens()[1].index);
|
||||
EXPECT_EQ(&p.GetAllocator(), &q.GetAllocator());
|
||||
|
||||
// Copied pointer needs to have its own allocator
|
||||
EXPECT_NE(&p.GetAllocator(), &q.GetAllocator());
|
||||
}
|
||||
|
||||
// Static tokens
|
||||
@@ -1668,3 +1670,14 @@ TEST(Pointer, Issue483) {
|
||||
value.SetString(mystr.c_str(), static_cast<SizeType>(mystr.length()), document.GetAllocator());
|
||||
myjson::Pointer(path.c_str()).Set(document, value, document.GetAllocator());
|
||||
}
|
||||
|
||||
TEST(Pointer, Issue1899) {
|
||||
typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
|
||||
PointerType p;
|
||||
PointerType q = p.Append("foo");
|
||||
EXPECT_TRUE(PointerType("/foo") == q);
|
||||
q = q.Append(1234);
|
||||
EXPECT_TRUE(PointerType("/foo/1234") == q);
|
||||
q = q.Append("");
|
||||
EXPECT_TRUE(PointerType("/foo/1234/") == q);
|
||||
}
|
||||
Reference in New Issue
Block a user