DALI_TEST_CHECK( text.IsEmpty() );
- Text someText( std::string( "Some text" ) );
+ Text someEmptyText1( "" );
- DALI_TEST_CHECK( !someText.IsEmpty() );
+ DALI_TEST_CHECK( someEmptyText1.IsEmpty() );
- Text someEmptyText( std::string( "" ) );
+ Text someEmptyText2( std::string( "" ) );
- DALI_TEST_CHECK( someEmptyText.IsEmpty() );
+ DALI_TEST_CHECK( someEmptyText2.IsEmpty() );
+
+ Text someEmptyText3( text );
+
+ DALI_TEST_CHECK( someEmptyText3.IsEmpty() );
+
+ Text someText1( "Some text" );
- Text someText2( Text( std::string( "Some text" ) ) );
+ DALI_TEST_CHECK( !someText1.IsEmpty() );
+
+ Text someText2( std::string( "Some text" ) );
DALI_TEST_CHECK( !someText2.IsEmpty() );
- Text someEmptyText2( text );
+ Text someText3( Text( std::string( "Some text" ) ) );
- DALI_TEST_CHECK( someEmptyText2.IsEmpty() );
+ DALI_TEST_CHECK( !someText3.IsEmpty() );
- Character c = someText[0];
+ Character c = someText1[0];
Text cText( c );
{
TestApplication application;
- const std::string someText( "Some text" );
+ const char* someText = "Some text";
const std::string someText2( "Some text2" );
Text text;
catch( DaliException& e )
{
tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "position < mString.size() && \"Text::operator[]: Character position is out of bounds\"", TEST_LOCATION );
+ DALI_TEST_EQUALS( e.mCondition, "position < mString.Count() && \"Text::operator[]: Character position is out of bounds\"", TEST_LOCATION );
assert2 = true;
}
Text text( std::string( "Some text") );
- text.Append( std::string( "A" ) );
+ text.Append( "A" );
DALI_TEST_CHECK( std::string( "Some textA" ) == text.GetText() );
+ text.Append( std::string( "B" ) );
+
+ DALI_TEST_CHECK( std::string( "Some textAB" ) == text.GetText() );
+
Character c = text[0];
text.Append( c );
- DALI_TEST_CHECK( std::string( "Some textAS" ) == text.GetText() );
+ DALI_TEST_CHECK( std::string( "Some textABS" ) == text.GetText() );
- Text text2( std::string("B") );
+ Text text2( std::string("C") );
text.Append( text2 );
- DALI_TEST_CHECK( std::string( "Some textASB" ) == text.GetText() );
+ DALI_TEST_CHECK( std::string( "Some textABSC" ) == text.GetText() );
// append to a null text
catch( DaliException& e )
{
tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "position < mString.size() && \"Text::Remove: Character position is out of bounds\"", TEST_LOCATION );
+ DALI_TEST_EQUALS( e.mCondition, "position < mString.Count() && \"Text::Remove: Character position is out of bounds\"", TEST_LOCATION );
assert1 = true;
}
catch( DaliException& e )
{
tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "position + numberOfCharacters <= mString.size() && \"Text::Remove: Character position + numberOfCharacters is out of bounds\"", TEST_LOCATION );
+ DALI_TEST_EQUALS( e.mCondition, "position + numberOfCharacters <= mString.Count() && \"Text::Remove: Character position + numberOfCharacters is out of bounds\"", TEST_LOCATION );
assert2 = true;
}