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-TextSelectionPopupMirroringRTL.cpp;h=dc76c3cb54694bfd99593ce3461ba89be00b347c;hp=930e85e26dfadada0023b1607e6c04ab3277ea20;hb=HEAD;hpb=3a2513b13b587a3a7ec2fa7224c2bb6f0ff1ef8c diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopupMirroringRTL.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopupMirroringRTL.cpp index 930e85e..187de57 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopupMirroringRTL.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopupMirroringRTL.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -15,39 +15,38 @@ * */ -#include -#include -#include -#include -#include #include #include #include +#include +#include +#include +#include +#include using namespace Dali; using namespace Toolkit; namespace { - -const char* DEFAULT_LOCALE_DIR = "/tmp/locale/"; +const char* DEFAULT_LOCALE_DIR = "/tmp/locale/"; static std::string gLocaleLang; static std::string gLocaleLanguage; -} +} // namespace void dali_textselectionpopupmirroringrtl_startup(void) { // Keep the current locale environment. - char* langPtr = getenv( "LANG" ); - gLocaleLang = std::string( langPtr ); + char* langPtr = getenv("LANG"); + gLocaleLang = std::string(langPtr); - char* languagePtr = getenv( "LANGUAGE" ); - gLocaleLanguage = std::string( languagePtr ); + char* languagePtr = getenv("LANGUAGE"); + gLocaleLanguage = std::string(languagePtr); // Set the locale environment to Arabic. - setenv( "LANG", "ar_AE.UTF-8", 1 ); - setenv( "LANGUAGE", "ar_AE:ar", 1 ); + setenv("LANG", "ar_AE.UTF-8", 1); + setenv("LANGUAGE", "ar_AE:ar", 1); test_return_value = TET_UNDEF; } @@ -55,8 +54,8 @@ void dali_textselectionpopupmirroringrtl_startup(void) void dali_textselectionpopupmirroringrtl_cleanup(void) { // Restore the locale environment. - setenv( "LANG", gLocaleLang.c_str(), 1 ); - setenv( "LANGUAGE", gLocaleLanguage.c_str(), 1 ); + setenv("LANG", gLocaleLang.c_str(), 1); + setenv("LANGUAGE", gLocaleLanguage.c_str(), 1); test_return_value = TET_PASS; } @@ -64,41 +63,41 @@ void dali_textselectionpopupmirroringrtl_cleanup(void) int UtcDaliToolkitTextSelectionPopupMirroringRTL(void) { // Test the popup mirroring. - const std::string CUT( "optionCut" ); - const std::string COPY( "optionCopy" ); - const std::string PASTE( "optionPaste" ); + const std::string CUT("optionCut"); + const std::string COPY("optionCopy"); + const std::string PASTE("optionPaste"); ToolkitTestApplication application; - setlocale( LC_ALL, "ar_AE.UTF-8" ); + setlocale(LC_ALL, "ar_AE.UTF-8"); textdomain("dali-toolkit"); - bindtextdomain("dali-toolkit", DEFAULT_LOCALE_DIR ); + bindtextdomain("dali-toolkit", DEFAULT_LOCALE_DIR); - TextSelectionPopup textSelectionPopup = TextSelectionPopup::New( NULL ); + TextSelectionPopup textSelectionPopup = TextSelectionPopup::New(NULL); // Enable some buttons. - TextSelectionPopup::Buttons buttons = static_cast( TextSelectionPopup::COPY | TextSelectionPopup::CUT | TextSelectionPopup::PASTE ); - textSelectionPopup.EnableButtons( buttons ); + TextSelectionPopup::Buttons buttons = static_cast(TextSelectionPopup::COPY | TextSelectionPopup::CUT | TextSelectionPopup::PASTE); + textSelectionPopup.EnableButtons(buttons); // Show the popup. textSelectionPopup.ShowPopup(); - Actor cutActor = textSelectionPopup.FindChildByName( CUT ); - if( !cutActor ) + Actor cutActor = textSelectionPopup.FindChildByName(CUT); + if(!cutActor) { tet_result(TET_FAIL); } Actor tableOfButtons = cutActor.GetParent(); - if( !tableOfButtons ) + if(!tableOfButtons) { tet_result(TET_FAIL); } // The order should be PASTE, CUT, COPY - DALI_TEST_EQUALS( PASTE, tableOfButtons.GetChildAt( 0 ).GetName(), TEST_LOCATION ); - DALI_TEST_EQUALS( CUT, tableOfButtons.GetChildAt( 2 ).GetName(), TEST_LOCATION ); - DALI_TEST_EQUALS( COPY, tableOfButtons.GetChildAt( 4 ).GetName(), TEST_LOCATION ); + DALI_TEST_EQUALS(PASTE, tableOfButtons.GetChildAt(0).GetProperty(Dali::Actor::Property::NAME), TEST_LOCATION); + DALI_TEST_EQUALS(CUT, tableOfButtons.GetChildAt(2).GetProperty(Dali::Actor::Property::NAME), TEST_LOCATION); + DALI_TEST_EQUALS(COPY, tableOfButtons.GetChildAt(4).GetProperty(Dali::Actor::Property::NAME), TEST_LOCATION); tet_result(TET_PASS); END_TEST;