X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-VisualModel.cpp;h=c36fed6b10341942e9362cb7f7152ecb9a789424;hb=68b0edb7de863b5198ec0afeac0a7e351dd6bd24;hp=fdde25451270b7704f2e65eb4bab53fac3155983;hpb=d8cbd048a3d77a627c97eba193afd3c0514a789a;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-VisualModel.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-VisualModel.cpp index fdde254..c36fed6 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-VisualModel.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-VisualModel.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include using namespace Dali; @@ -65,8 +65,9 @@ struct SetCharacterToGlyphData bool SetGlyphsPerCharacterTest( const SetGlyphsPerCharacterData& data ) { // 1) Create the model. - LogicalModelPtr logicalModel = LogicalModel::New(); - VisualModelPtr visualModel = VisualModel::New(); + LogicalModelPtr logicalModel; + VisualModelPtr visualModel; + MetricsPtr metrics; Size textArea(100.f, 60.f); Size layoutSize; @@ -78,16 +79,21 @@ bool SetGlyphsPerCharacterTest( const SetGlyphsPerCharacterData& data ) options, layoutSize, logicalModel, - visualModel ); + visualModel, + metrics, + false ); - // 2) Clear the model. Vector& charactersToGlyph = visualModel->mCharactersToGlyph; Vector& glyphsPerCharacter = visualModel->mGlyphsPerCharacter; + // 2) Clear the model. + + GlyphIndex startGlyphIndex = 0u; if( 0u != charactersToGlyph.Count() ) { // The number of glyphs to be removed. const Length numberOfGlyphs = charactersToGlyph[data.startIndex + data.numberOfCharacters - 1u] + glyphsPerCharacter[data.startIndex + data.numberOfCharacters - 1u] - charactersToGlyph[data.startIndex]; + startGlyphIndex = charactersToGlyph[data.startIndex]; charactersToGlyph.Erase( charactersToGlyph.Begin() + data.startIndex, charactersToGlyph.Begin() + data.startIndex + data.numberOfCharacters ); @@ -106,6 +112,7 @@ bool SetGlyphsPerCharacterTest( const SetGlyphsPerCharacterData& data ) // 3) Call the CreateGlyphsPerCharacterTable() function visualModel->CreateGlyphsPerCharacterTable( data.startIndex, + startGlyphIndex, data.numberOfCharacters ); // 4) Compare the results. @@ -141,8 +148,9 @@ bool SetGlyphsPerCharacterTest( const SetGlyphsPerCharacterData& data ) bool SetCharacterToGlyphTest( const SetCharacterToGlyphData& data ) { // 1) Create the model. - LogicalModelPtr logicalModel = LogicalModel::New(); - VisualModelPtr visualModel = VisualModel::New(); + LogicalModelPtr logicalModel; + VisualModelPtr visualModel; + MetricsPtr metrics; Size textArea(100.f, 60.f); Size layoutSize; @@ -154,16 +162,21 @@ bool SetCharacterToGlyphTest( const SetCharacterToGlyphData& data ) options, layoutSize, logicalModel, - visualModel ); + visualModel, + metrics, + false ); - // 2) Clear the model. Vector& charactersToGlyph = visualModel->mCharactersToGlyph; Vector& glyphsPerCharacter = visualModel->mGlyphsPerCharacter; + // 2) Clear the model. + + GlyphIndex startGlyphIndex = 0u; if( 0u != charactersToGlyph.Count() ) { // The number of glyphs to be removed. const Length numberOfGlyphs = charactersToGlyph[data.startIndex + data.numberOfCharacters - 1u] + glyphsPerCharacter[data.startIndex + data.numberOfCharacters - 1u] - charactersToGlyph[data.startIndex]; + startGlyphIndex = charactersToGlyph[data.startIndex]; charactersToGlyph.Erase( charactersToGlyph.Begin() + data.startIndex, charactersToGlyph.Begin() + data.startIndex + data.numberOfCharacters ); @@ -180,6 +193,7 @@ bool SetCharacterToGlyphTest( const SetCharacterToGlyphData& data ) // 3) Call the CreateCharacterToGlyphTable() function visualModel->CreateCharacterToGlyphTable( data.startIndex, + startGlyphIndex, data.numberOfCharacters ); // 4) Compare the results. @@ -218,7 +232,6 @@ bool SetCharacterToGlyphTest( const SetCharacterToGlyphData& data ) int UtcDaliSetGlyphsPerCharacter(void) { - ToolkitTestApplication application; tet_infoline(" UtcDaliSetGlyphsPerCharacter"); Length glyphsPerCharacter02[] = { 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u, 1u }; @@ -285,6 +298,7 @@ int UtcDaliSetGlyphsPerCharacter(void) for( unsigned int index = 0u; index < numberOfTests; ++index ) { + ToolkitTestApplication application; if( !SetGlyphsPerCharacterTest( data[index] ) ) { tet_result(TET_FAIL); @@ -297,7 +311,6 @@ int UtcDaliSetGlyphsPerCharacter(void) int UtcDaliSetCharacterToGlyph(void) { - ToolkitTestApplication application; tet_infoline(" UtcDaliSetGlyphsPerCharacter"); GlyphIndex glyphIndices02[] = { 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u }; @@ -362,6 +375,7 @@ int UtcDaliSetCharacterToGlyph(void) for( unsigned int index = 0u; index < numberOfTests; ++index ) { + ToolkitTestApplication application; if( !SetCharacterToGlyphTest( data[index] ) ) { tet_result(TET_FAIL);