summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-31 09:02:49 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-10-31 09:59:31 -0400
commit4d81d8bf3aaa6e243f3f0cf5aaa2572e7d669701 (patch)
tree3798c70372b5a5f005f0bc595ce1d3970429ee03
parent2f17b4c391504ac3f10bc6b41eeaa03701571906 (diff)
tests/spec: store test class and reuse globally to avoid needing efl_isa
Summary: Depends on D10569 Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10570
-rw-r--r--src/tests/elementary/spec/efl_test_pack_linear.c2
-rw-r--r--src/tests/elementary/spec/efl_ui_spec_suite.c2
-rw-r--r--src/tests/elementary/spec/efl_ui_spec_suite.h1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/tests/elementary/spec/efl_test_pack_linear.c b/src/tests/elementary/spec/efl_test_pack_linear.c
index 3886dfde9b..98ca1ef99f 100644
--- a/src/tests/elementary/spec/efl_test_pack_linear.c
+++ b/src/tests/elementary/spec/efl_test_pack_linear.c
@@ -471,7 +471,7 @@ EFL_END_TEST
471void 471void
472object_setup(void) 472object_setup(void)
473{ 473{
474 if (efl_isa(widget, EFL_UI_GROUP_ITEM_CLASS)) 474 if (widget_klass == EFL_UI_GROUP_ITEM_CLASS)
475 { 475 {
476 Efl_Ui_Collection *collection = efl_add(EFL_UI_GRID_CLASS, win); 476 Efl_Ui_Collection *collection = efl_add(EFL_UI_GRID_CLASS, win);
477 efl_content_set(win, collection); 477 efl_content_set(win, collection);
diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.c b/src/tests/elementary/spec/efl_ui_spec_suite.c
index 50b32c362e..36b51b58c3 100644
--- a/src/tests/elementary/spec/efl_ui_spec_suite.c
+++ b/src/tests/elementary/spec/efl_ui_spec_suite.c
@@ -11,6 +11,7 @@
11Evas_Object *win = NULL; 11Evas_Object *win = NULL;
12Evas_Object *widget = NULL; 12Evas_Object *widget = NULL;
13const Efl_Class *test_content_klass = NULL; 13const Efl_Class *test_content_klass = NULL;
14const Efl_Class *widget_klass = NULL;
14EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS); 15EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS);
15EFL_CLASS_SIMPLE_CLASS(efl_ui_item, "efl_ui_item", EFL_UI_ITEM_CLASS); 16EFL_CLASS_SIMPLE_CLASS(efl_ui_item, "efl_ui_item", EFL_UI_ITEM_CLASS);
16#define EFL_UI_ITEM_REALIZED_CLASS efl_ui_item_realized_class_get() 17#define EFL_UI_ITEM_REALIZED_CLASS efl_ui_item_realized_class_get()
@@ -22,6 +23,7 @@ _setup_window_and_widget(const Efl_Class *klass, const Efl_Class *content_klass)
22 ck_assert(!widget); 23 ck_assert(!widget);
23 24
24 test_content_klass = content_klass; 25 test_content_klass = content_klass;
26 widget_klass = klass;
25 win = win_add(); 27 win = win_add();
26 widget = efl_add(klass, win); 28 widget = efl_add(klass, win);
27 efl_content_set(win, widget); 29 efl_content_set(win, widget);
diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.h b/src/tests/elementary/spec/efl_ui_spec_suite.h
index 10b8f3b9b1..6d20c60a0a 100644
--- a/src/tests/elementary/spec/efl_ui_spec_suite.h
+++ b/src/tests/elementary/spec/efl_ui_spec_suite.h
@@ -9,6 +9,7 @@
9 9
10extern Eo *win; 10extern Eo *win;
11extern Eo *widget; 11extern Eo *widget;
12extern const Efl_Class *widget_klass;
12 13
13void efl_pack_behavior_test(TCase *tc); 14void efl_pack_behavior_test(TCase *tc);
14void efl_pack_linear_behavior_test(TCase *tc); 15void efl_pack_linear_behavior_test(TCase *tc);