efl: streamline DayselectorUserTest
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Wed, 5 Jun 2013 02:43:05 +0000 (19:43 -0700)
committerU. Artie Eoff <ullysses.a.eoff@intel.com>
Wed, 5 Jun 2013 02:43:05 +0000 (19:43 -0700)
Move the SUNDAY special case into the loop by using the modulo
operator to choose correct day selection and label.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
src/test/efl/test_dayselector.cpp

index 64e1b5a..27e2b70 100644 (file)
@@ -186,7 +186,8 @@ public:
        void test(){
                YIELD_UNTIL(rendered_);
 
-               for (unsigned i(0); i <= 5; ++i) {
+               for (unsigned i(0); i <= 6; ++i) {
+                       // ELM_DAYSELECTOR_SUN=0; dayStr = day6
                        const std::string dayStr("day" + boost::lexical_cast<std::string>(i));
 
                        changed_ = false;
@@ -195,20 +196,11 @@ public:
 
                        const Eina_Bool result = elm_dayselector_day_selected_get(
                                dayselector_,
-                               static_cast<Elm_Dayselector_Day>(i + 1)
+                               static_cast<Elm_Dayselector_Day>( (i + 1) % 7)
                        );
                        FAIL_IF(result == EINA_FALSE);
                }
 
-               //This is done outside the loop because ELM_DAYSELECTOR_SUN=0
-               changed_ = false;
-               clickDay("day6");
-               YIELD_UNTIL(changed_);
-               const Eina_Bool result = elm_dayselector_day_selected_get(
-                       dayselector_, ELM_DAYSELECTOR_SUN
-               );
-               FAIL_IF(result == EINA_FALSE);
-
                //Test all are clicked.
                testAllSelected();
        }