forked from bblanchon/ArduinoJson
Test that char* are copied
This commit is contained in:
1 parent
e417c137fc
commit
d3cf568d07
2 files changed
+9
-1
No files matched your search
@@ -49,7 +49,6 @@ void JsonValue::operator=(JsonValue const& value)
|
|||||||
|
|
||||||
JsonNodeType nodeType = value._node ? value._node->type : JSON_UNDEFINED;
|
JsonNodeType nodeType = value._node ? value._node->type : JSON_UNDEFINED;
|
||||||
|
|
||||||
|
|
||||||
switch (nodeType)
|
switch (nodeType)
|
||||||
{
|
{
|
||||||
case JSON_UNDEFINED:
|
case JSON_UNDEFINED:
|
||||||
|
|||||||
@@ -85,3 +85,12 @@ TEST_F(JsonValueTests, BooleanValuesAreCopied)
|
|||||||
|
|
||||||
EXPECT_TRUE((bool) jsonValue2);
|
EXPECT_TRUE((bool) jsonValue2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(JsonValueTests, CharPointersAreCopied)
|
||||||
|
{
|
||||||
|
jsonValue1 = "hello";
|
||||||
|
jsonValue2 = jsonValue1;
|
||||||
|
jsonValue1 = "world";
|
||||||
|
|
||||||
|
EXPECT_STREQ("hello", (const char*) jsonValue2);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user