rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=f8558eb29e5dd4f9069aef1db378b2dc58876c71

commit f8558eb29e5dd4f9069aef1db378b2dc58876c71
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Thu Jul 23 19:08:14 2015 +0300

    UTC: fix workspace_zoom_factor tests
---
 tests/edj_build/Makefile.am                        |  1 +
 tests/test_ui_workspace/test_ui_workspace.c        |  3 +-
 tests/test_ui_workspace/test_ui_workspace.h        |  6 +--
 .../test_ui_workspace/workspace_zoom_factor_get.c  | 37 ++++++++------
 .../test_ui_workspace/workspace_zoom_factor_set.c  | 58 ++++++++++++++++++++++
 5 files changed, 84 insertions(+), 21 deletions(-)

diff --git a/tests/edj_build/Makefile.am b/tests/edj_build/Makefile.am
index a551012..7c56648 100644
--- a/tests/edj_build/Makefile.am
+++ b/tests/edj_build/Makefile.am
@@ -12,6 +12,7 @@ check: Makefile
        $(builddir)/radio.edc \
        $(builddir)/radio.edj
        for i in \
+       $(builddir)/ui_workspace.edj \
        $(builddir)/workspace_edit_object_part_state_del.edj \
        $(builddir)/workspace_background_image_set.edj \
        $(builddir)/workspace_highlight_unset.edj \
diff --git a/tests/test_ui_workspace/test_ui_workspace.c 
b/tests/test_ui_workspace/test_ui_workspace.c
index c54f41d..74710be 100644
--- a/tests/test_ui_workspace/test_ui_workspace.c
+++ b/tests/test_ui_workspace/test_ui_workspace.c
@@ -74,7 +74,8 @@ Suite* test_suite (void) {
    tcase_add_test(tcase, workspace_separate_mode_get_test_p2);
    tcase_add_test(tcase, workspace_separate_mode_set_test_p1);
    tcase_add_test(tcase, workspace_separate_mode_set_test_p2);
-   //tcase_add_test(tcase, workspace_zoom_factor_get_test_p);
+   tcase_add_test(tcase, workspace_zoom_factor_set_test_p);
+   tcase_add_test(tcase, workspace_zoom_factor_get_test_p);
 
    suite_add_tcase(suite, tcase);
    return suite;
diff --git a/tests/test_ui_workspace/test_ui_workspace.h 
b/tests/test_ui_workspace/test_ui_workspace.h
index a0eb02d..77be9bb 100644
--- a/tests/test_ui_workspace/test_ui_workspace.h
+++ b/tests/test_ui_workspace/test_ui_workspace.h
@@ -22,6 +22,7 @@
 #include "main_window.h"
 #include "utc_common.h"
 
+#define TEST_NAME "ui_workspace"
 /**
  * @defgroup test_ui_workspace
  */
@@ -78,7 +79,4 @@ void workspace_separate_mode_get_test_p2(int);
 void workspace_separate_mode_set_test_p1(int);
 void workspace_separate_mode_set_test_p2(int);
 void workspace_zoom_factor_get_test_p(int);
-void workspace_zoom_factor_set_n1(int);
-void workspace_zoom_factor_set_n2(int);
-void workspace_zoom_factor_set_n3(int);
-void workspace_zoom_factor_set_p(int);
+void workspace_zoom_factor_set_test_p(int);
diff --git a/tests/test_ui_workspace/workspace_zoom_factor_get.c 
b/tests/test_ui_workspace/workspace_zoom_factor_get.c
index f52c1a0..47828ad 100644
--- a/tests/test_ui_workspace/workspace_zoom_factor_get.c
+++ b/tests/test_ui_workspace/workspace_zoom_factor_get.c
@@ -18,6 +18,8 @@
  */
 
 #include "test_ui_workspace.h"
+#include "main_window.h"
+#include "test_common.h"
 
 /**
  * @addtogroup ui_workspace_test
@@ -58,27 +60,30 @@
  */
 EFLETE_TEST (workspace_zoom_factor_get_test_p)
 {
+   App_Data *app = NULL;
+   Style *style = NULL;
+
    elm_init(0, 0);
    app_init();
-   App_Data *ap = app_data_get();
-   double res = -1;
-   Style *style = NULL;
-   Evas *e = NULL;
-   Eina_File *mmap_file = NULL;
+   setup("workspace_zoom_factor_get_test_p");
+
+   app = app_data_get();
+   ui_main_window_add(app);
+   app->project = 
pm_project_open("./workspace_zoom_factor_get_test_p/workspace_zoom_factor_get_test_p.pro");
+   wm_widgets_list_objects_load(app->project->widgets,
+                                evas_object_evas_get(app->win), 
app->project->mmap_file);
+   blocks_show(app);
+   style = wm_style_object_find(app->project->widgets, "elm/radio/base/def");
+   ui_style_clicked(app, style);
+   workspace_zoom_factor_set(app->workspace, 1.5);
 
-   ui_main_window_add(ap);
-   mmap_file = eina_file_open("./edj_build/workspace_zoom_factor_get.edj", 
EINA_FALSE);
-   e = evas_object_evas_get(ap->workspace);
-   style = wm_style_add("test", "elm/radio/base/def", STYLE, NULL);
-   wm_style_data_load(style, e, mmap_file);
-   workspace_edit_object_set(ap->workspace, style, 
"./edj_build/workspace_zoom_factor_get.edj");
-   workspace_zoom_factor_set(ap->workspace, 1.5);
-   res = workspace_zoom_factor_get(ap->workspace);
-   ck_assert_msg(res == 1.5, "Failed get zoom factor");
+   ck_assert_msg(workspace_zoom_factor_get(app->workspace) == 1.5, "Failed get 
zoom factor");
 
-   wm_style_free(style);
-   eina_file_close(mmap_file);
+   pm_project_close(app->project);
+   app->project = NULL;
+   ui_main_window_del(app);
    app_shutdown();
+   teardown("./workspace_zoom_factor_get_test_p");
    elm_shutdown();
 }
 END_TEST
diff --git a/tests/test_ui_workspace/workspace_zoom_factor_set.c 
b/tests/test_ui_workspace/workspace_zoom_factor_set.c
index c641e58..41552db 100644
--- a/tests/test_ui_workspace/workspace_zoom_factor_set.c
+++ b/tests/test_ui_workspace/workspace_zoom_factor_set.c
@@ -18,12 +18,70 @@
  */
 
 #include "test_ui_workspace.h"
+#include "main_window.h"
+#include "test_common.h"
 
 /**
  * @addtogroup ui_workspace_test
  * @{
  */
 
+/**
+ * @addtogroup workspace_zoom_factor_set
+ * @{
+ * <tr>
+ * <td>workspace_zoom_factor_set</td>
+ * <td>workspace_zoom_factor_set_test_p</td>
+ * <td>
+ * @precondition
+ * @step 1 initialize elementary library
+ * @step 2 load extenstion theme from EFLETE_THEME file
+ * @step 3 create parent window
+ * @step 4 Mmap edj file.
+ * @step 5 create workspace object
+ * @step 6 create style
+ * @step 7 load data into created style from edj file
+ * @step 8 set loaded object into workspace
+ *
+ * @procedure
+ * @step 1 call workspace_zoom_factor_set
+ * @step 2 check returned value
+ * </td>
+ * <td>1.5</td>
+ * <td>EINA_TRUE returned</td>
+ * </tr>
+ * @}
+ */
+EFLETE_TEST (workspace_zoom_factor_set_test_p)
+{
+   App_Data *app = NULL;
+   Style *style = NULL;
+
+   elm_init(0, 0);
+   app_init();
+   setup("workspace_zoom_factor_get_test_p");
+
+   app = app_data_get();
+   ui_main_window_add(app);
+   app->project = 
pm_project_open("./workspace_zoom_factor_get_test_p/workspace_zoom_factor_get_test_p.pro");
+   wm_widgets_list_objects_load(app->project->widgets,
+                                evas_object_evas_get(app->win), 
app->project->mmap_file);
+   blocks_show(app);
+   style = wm_style_object_find(app->project->widgets, "elm/radio/base/def");
+   ui_style_clicked(app, style);
+
+   ck_assert_msg(workspace_zoom_factor_set(app->workspace, 1.5), "Failed get 
zoom factor");
+
+   pm_project_close(app->project);
+   app->project = NULL;
+   ui_main_window_del(app);
+   app_shutdown();
+   teardown("./workspace_zoom_factor_get_test_p");
+   elm_shutdown();
+}
+END_TEST
+
+
 /*
  * @}
  */

-- 


Reply via email to