X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-JsonParser.cpp;h=1fafb16840b3c03451003264e01ed98a21723ed2;hp=a1ebacd02de3cedef25da8bbf3d7b2231898e94b;hb=3a289377436005f632a2dca8916706879b7e3a28;hpb=e6bf46a6c76b0000dd5174ae406cc62ca8f5d9c2 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-JsonParser.cpp b/automated-tests/src/dali-toolkit/utc-Dali-JsonParser.cpp index a1ebacd..1fafb16 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-JsonParser.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-JsonParser.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include using namespace Dali; using namespace Dali::Toolkit; @@ -332,8 +332,8 @@ int UtcDaliJsonParserMethod04(void) 'actor':'bump-image', \ 'property':'uLightPosition', \ 'value':[0.8, 0.0, -1.5], \ - 'alpha-function': 'BOUNCE', \ - 'time-period': { 'duration': 2.5 } \ + 'alphaFunction': 'BOUNCE', \ + 'timePeriod': { 'duration': 2.5 } \ } \ ] \ } \ @@ -349,7 +349,7 @@ int UtcDaliJsonParserMethod04(void) { \ 'duration': 5.0, \ 'loop': true, \ - 'end-action':'DISCARD' \ + 'endAction':'DISCARD' \ } \ } \ } \ @@ -411,8 +411,8 @@ int UtcDaliJsonParserMethod05(void) 'actor':'bump-image', \ 'property':'uLightPosition', \ 'value':[0.8, 0.0, -1.5], \ - 'alpha-function': 'BOUNCE', \ - 'time-period': { 'duration': 2.5 } \ + 'alphaFunction': 'BOUNCE', \ + 'timePeriod': { 'duration': 2.5 } \ } \ ] \ } \ @@ -699,8 +699,8 @@ int UtcDaliJsonParserMethod11(void) 'actor':'bump-image', \ 'property':'uLightPosition', \ 'value':[0.8, 0.0, -1.5], \ - 'alpha-function': 'BOUNCE', \ - 'time-period': { 'duration': 2.5 } \ + 'alphaFunction': 'BOUNCE', \ + 'timePeriod': { 'duration': 2.5 } \ } \ ] \ } \ @@ -722,3 +722,37 @@ int UtcDaliJsonParserMethod11(void) tet_result(TET_PASS); END_TEST; } + + +int UtcDaliJsonParserMerge1(void) +{ + ToolkitTestApplication application; + tet_infoline("JSON tree merge"); + + std::string s1( ReplaceQuotes(" \ +{ \ + 'styles': \ + { \ + 'button': \ + { \ + 'backgroundColor':[0.8, 0.0, 1.0, 1.0], \ + 'foregroundColor':[1, 1, 1, 1] \ + } \ + } \ +} \ +")); + + JsonParser parser = JsonParser::New(); + JsonParser testParser = JsonParser::New(); + + testParser.Parse( s1 ); + + parser.Parse( s1 ); + parser.Parse( s1 ); // Merge the tree into itself. The value array should not grow. + + DALI_TEST_CHECK(parser.GetRoot()); + + CompareTrees( *parser.GetRoot(), *testParser.GetRoot() ); + + END_TEST; +}