/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Vector<Character> utf32;
utf32.Resize( data.text.size() );
- const uint32_t numberOfCharacters = Utf8ToUtf32( reinterpret_cast<const uint8_t* const>( data.text.c_str() ),
- data.text.size(),
- &utf32[0u] );
+ const uint32_t numberOfCharacters = ( data.text.size() == 0 ) ? 0 :
+ Utf8ToUtf32( reinterpret_cast<const uint8_t* const>( data.text.c_str() ),
+ data.text.size(),
+ &utf32[0u] );
+
utf32.Resize( numberOfCharacters );
// 2) Set the script info.
if( scriptRun1.script != scriptRun2.script )
{
- tet_printf("ScriptsTest FAIL: different script. %s, should be %s\n", TextAbstraction::ScriptName[scriptRun1.script], TextAbstraction::ScriptName[scriptRun2.script] );
+ tet_printf("ScriptsTest FAIL: script index: %u, different script. %s, should be %s\n", index, TextAbstraction::ScriptName[scriptRun1.script], TextAbstraction::ScriptName[scriptRun2.script] );
return false;
}
}
Vector<Character> utf32;
utf32.Resize( data.text.size() );
- const uint32_t numberOfCharacters = Utf8ToUtf32( reinterpret_cast<const uint8_t* const>( data.text.c_str() ),
+ const uint32_t numberOfCharacters = (data.text.size() == 0 ) ? 0 :
+ Utf8ToUtf32( reinterpret_cast<const uint8_t* const>( data.text.c_str() ),
data.text.size(),
&utf32[0u] );
utf32.Resize( numberOfCharacters );
0u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1101 =
{
3u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1102 =
{
25u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1104 =
{
28u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1105 =
{
46u,
2u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1107 =
{
48u,
2u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1108 =
{
50u,
2u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
scriptRuns11.PushBack( scriptRun1100 );
scriptRuns11.PushBack( scriptRun1101 );
0u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1201 =
{
3u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1202 =
{
6u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1203 =
{
9u,
2u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
scriptRuns12.PushBack( scriptRun1200 );
scriptRuns12.PushBack( scriptRun1201 );
0u,
4u,
},
- TextAbstraction::LATIN // An unknown script is transformed to LATIN
+ TextAbstraction::UNKNOWN
};
scriptRuns13.PushBack( scriptRun1301 );