mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-28 19:52:02 +01:00
Fixed Issue 38: Segmentation fault with CrtAllocator
git-svn-id: https://rapidjson.googlecode.com/svn/trunk@80 c5894555-1306-4e8d-425f-1f6f381ee07c
This commit is contained in:
@@ -591,3 +591,15 @@ TEST(Value, RemoveLastElement) {
|
||||
objVal.RemoveMember("var3"); // Assertion here in r61
|
||||
EXPECT_FALSE(objVal.HasMember("var3"));
|
||||
}
|
||||
|
||||
// Issue 38: Segmentation fault with CrtAllocator
|
||||
TEST(Document, CrtAllocator) {
|
||||
typedef GenericValue<UTF8<>, CrtAllocator> V;
|
||||
|
||||
V::AllocatorType allocator;
|
||||
V o(kObjectType);
|
||||
o.AddMember("x", 1, allocator); // Should not call destructor on uninitialized name/value of newly allocated members.
|
||||
|
||||
V a(kArrayType);
|
||||
a.PushBack(1, allocator); // Should not call destructor on uninitialized Value of newly allocated elements.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user