{
const char* DEFAULT_LOCALE_DIR = "/tmp/locale/";
-const std::string DEFAULT_EN_LOCALE_DIR = "/tmp/locale/en/LC_MESSAGES/";
+static std::string gLocaleLang;
+static std::string gLocaleLanguage;
}
void dali_textselectionpopupmirroringltr_startup(void)
{
- // Cheat! Copy the .mo file
- std::ifstream src( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo.en" ).c_str(), std::ifstream::binary );
- std::ofstream dst( std::string( DEFAULT_EN_LOCALE_DIR + "dali-toolkit.mo" ).c_str(), std::ofstream::binary );
- dst << src.rdbuf();
+ // Keep the current locale environment.
+ char* langPtr = getenv( "LANG" );
+ gLocaleLang = std::string( langPtr );
+
+ char* languagePtr = getenv( "LANGUAGE" );
+ gLocaleLanguage = std::string( languagePtr );
+
+ // Set the locale environment to Arabic.
+ setenv( "LANG", "en_GB.UTF-8", 1 );
+ setenv( "LANGUAGE", "en_GB:en", 1 );
test_return_value = TET_UNDEF;
}
void dali_textselectionpopupmirroringltr_cleanup(void)
{
+ // Restore the locale environment.
+ setenv( "LANG", gLocaleLang.c_str(), 1 );
+ setenv( "LANGUAGE", gLocaleLanguage.c_str(), 1 );
+
test_return_value = TET_PASS;
}
}
// The order should be COPY, CUT, PASTE
- DALI_TEST_EQUALS( COPY, tableOfButtons.GetChildAt( 0 ).GetName(), TEST_LOCATION );
- DALI_TEST_EQUALS( CUT, tableOfButtons.GetChildAt( 2 ).GetName(), TEST_LOCATION );
- DALI_TEST_EQUALS( PASTE, tableOfButtons.GetChildAt( 4 ).GetName(), TEST_LOCATION );
+ DALI_TEST_EQUALS( COPY, tableOfButtons.GetChildAt( 0 ).GetProperty< std::string >( Dali::Actor::Property::NAME ), TEST_LOCATION );
+ DALI_TEST_EQUALS( CUT, tableOfButtons.GetChildAt( 2 ).GetProperty< std::string >( Dali::Actor::Property::NAME ), TEST_LOCATION );
+ DALI_TEST_EQUALS( PASTE, tableOfButtons.GetChildAt( 4 ).GetProperty< std::string >( Dali::Actor::Property::NAME ), TEST_LOCATION );
tet_result(TET_PASS);
END_TEST;