summaryrefslogtreecommitdiff
path: root/src/tests/elementary/spec
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/elementary/spec')
-rw-r--r--src/tests/elementary/spec/efl_test_basics.c26
-rw-r--r--src/tests/elementary/spec/efl_test_clickable.c6
-rw-r--r--src/tests/elementary/spec/efl_test_content.c10
-rw-r--r--src/tests/elementary/spec/efl_test_format.c4
-rw-r--r--src/tests/elementary/spec/efl_test_gfx_view.c2
-rw-r--r--src/tests/elementary/spec/efl_test_range_display.c4
-rw-r--r--src/tests/elementary/spec/efl_ui_spec_suite.c4
7 files changed, 42 insertions, 14 deletions
diff --git a/src/tests/elementary/spec/efl_test_basics.c b/src/tests/elementary/spec/efl_test_basics.c
index 0985adb..2774b2a 100644
--- a/src/tests/elementary/spec/efl_test_basics.c
+++ b/src/tests/elementary/spec/efl_test_basics.c
@@ -45,11 +45,12 @@
45 "Efl.Ui.Timepicker", 45 "Efl.Ui.Timepicker",
46 "Efl.Ui.Navigation_Bar", 46 "Efl.Ui.Navigation_Bar",
47 "Efl.Ui.Relative_Container", 47 "Efl.Ui.Relative_Container",
48 "Efl.Ui.Animation_View", 48 "Efl.Ui.Vg_Animation",
49 "Efl.Ui.Table", 49 "Efl.Ui.Table",
50 "Efl.Ui.Flip", 50 "Efl.Ui.Flip",
51 "Efl.Ui.Stack", 51 "Efl.Ui.Stack",
52 "Efl.Ui.Pager" 52 "Efl.Ui.Pager",
53 "Efl.Ui.Separator"
53 ], 54 ],
54 "custom-mapping" : { 55 "custom-mapping" : {
55 "Efl.Ui.Grid" : "EFL_UI_GRID_DEFAULT_ITEM_CLASS", 56 "Efl.Ui.Grid" : "EFL_UI_GRID_DEFAULT_ITEM_CLASS",
@@ -66,6 +67,8 @@ EFL_START_TEST(no_leaking_canvas_object)
66 Eina_Iterator *iter = eo_objects_iterator_new(); 67 Eina_Iterator *iter = eo_objects_iterator_new();
67 Eo *obj; 68 Eo *obj;
68 69
70 if (efl_isa(widget, EFL_UI_FLIP_CLASS)) return; //FIXME Flip needs more work for this. However, flip should be redone as a spotlight manager, When this is done, we can add these classes to the check here.
71
69 EINA_ITERATOR_FOREACH(iter, obj) 72 EINA_ITERATOR_FOREACH(iter, obj)
70 { 73 {
71 if (!efl_alive_get(obj)) continue; 74 if (!efl_alive_get(obj)) continue;
@@ -75,6 +78,12 @@ EFL_START_TEST(no_leaking_canvas_object)
75 } 78 }
76 eina_iterator_free(iter); 79 eina_iterator_free(iter);
77 80
81 //Just overwrite the widget pointer, and expect errors, if any error is happening here, we are not interested in it, another testcase will take care of them
82 EXPECT_ERROR_START;
83 widget = efl_add(widget_klass, win);
84 expect_error_start = EINA_TRUE;
85 EXPECT_ERROR_END;
86
78 //now try to will those widgets 87 //now try to will those widgets
79 if (efl_isa(widget, EFL_PACK_LINEAR_INTERFACE)) 88 if (efl_isa(widget, EFL_PACK_LINEAR_INTERFACE))
80 { 89 {
@@ -105,7 +114,10 @@ EFL_START_TEST(no_leaking_canvas_object)
105 if (!efl_alive_get(obj)) continue; 114 if (!efl_alive_get(obj)) continue;
106 if (!efl_isa(obj, EFL_CANVAS_OBJECT_CLASS)) continue; 115 if (!efl_isa(obj, EFL_CANVAS_OBJECT_CLASS)) continue;
107 116
108 ck_assert_ptr_ne(eina_list_data_find(not_invalidate, obj), NULL); 117 if (eina_list_data_find(not_invalidate, obj) == NULL)
118 {
119 ck_abort_msg("Leak detected %s Evas-Parent: %s", efl_debug_name_get(obj), efl_class_name_get(efl_canvas_object_render_parent_get(obj)));
120 }
109 } 121 }
110 eina_iterator_free(iter); 122 eina_iterator_free(iter);
111 123
@@ -113,6 +125,13 @@ EFL_START_TEST(no_leaking_canvas_object)
113} 125}
114EFL_END_TEST 126EFL_END_TEST
115 127
128
129EFL_START_TEST(no_err_on_creation)
130{
131 widget = efl_add(widget_klass, win);
132}
133EFL_END_TEST
134
116EFL_START_TEST(no_err_on_shutdown) 135EFL_START_TEST(no_err_on_shutdown)
117{ 136{
118 efl_ref(widget); 137 efl_ref(widget);
@@ -193,4 +212,5 @@ efl_ui_widget_behavior_test(TCase *tc)
193 tcase_add_test(tc, no_leaking_canvas_object); 212 tcase_add_test(tc, no_leaking_canvas_object);
194 tcase_add_test(tc, no_err_on_shutdown); 213 tcase_add_test(tc, no_err_on_shutdown);
195 tcase_add_test(tc, correct_visibility_setting); 214 tcase_add_test(tc, correct_visibility_setting);
215 tcase_add_test(tc, no_err_on_creation);
196} 216}
diff --git a/src/tests/elementary/spec/efl_test_clickable.c b/src/tests/elementary/spec/efl_test_clickable.c
index e6991f8..d297d29 100644
--- a/src/tests/elementary/spec/efl_test_clickable.c
+++ b/src/tests/elementary/spec/efl_test_clickable.c
@@ -12,7 +12,7 @@
12#include "elm_widget.h" 12#include "elm_widget.h"
13/* spec-meta-start 13/* spec-meta-start
14 {"test-interface":"Efl.Ui.Clickable", 14 {"test-interface":"Efl.Ui.Clickable",
15 "test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame", "Efl.Ui.Item.Realized", "Efl.Ui.Radio", "Efl.Ui.Check"] 15 "test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item", "Efl.Ui.List_Default_Item", "Efl.Ui.Radio", "Efl.Ui.Check"]
16 } 16 }
17 spec-meta-end 17 spec-meta-end
18 */ 18 */
@@ -64,10 +64,6 @@ prepare_window(void)
64 } 64 }
65 else if (efl_isa(widget, EFL_UI_ITEM_CLASS)) 65 else if (efl_isa(widget, EFL_UI_ITEM_CLASS))
66 { 66 {
67 elm_widget_theme_klass_set(widget, "grid_item");
68 elm_widget_theme_element_set(widget, NULL);
69 elm_widget_theme_style_set(widget, NULL);
70 efl_ui_widget_theme_apply(widget);
71 pos->x = 30; 67 pos->x = 30;
72 pos->y = 30; 68 pos->y = 30;
73 } 69 }
diff --git a/src/tests/elementary/spec/efl_test_content.c b/src/tests/elementary/spec/efl_test_content.c
index 4800a1b..98c3b36 100644
--- a/src/tests/elementary/spec/efl_test_content.c
+++ b/src/tests/elementary/spec/efl_test_content.c
@@ -27,6 +27,8 @@ EFL_START_TEST(content_set_get)
27 ck_assert_int_eq(efl_content_set(widget, (void*)0x1), EINA_FALSE); 27 ck_assert_int_eq(efl_content_set(widget, (void*)0x1), EINA_FALSE);
28 EXPECT_ERROR_END; 28 EXPECT_ERROR_END;
29 ck_assert_ptr_eq(efl_content_get(widget), NULL); 29 ck_assert_ptr_eq(efl_content_get(widget), NULL);
30
31 ck_assert_int_eq(efl_alive_get(w), EINA_FALSE);
30} 32}
31EFL_END_TEST 33EFL_END_TEST
32 34
@@ -39,7 +41,10 @@ EFL_START_TEST(content_set_get2)
39 ck_assert_ptr_eq(efl_content_get(widget), w); 41 ck_assert_ptr_eq(efl_content_get(widget), w);
40 42
41 ck_assert_int_eq(efl_content_set(widget, NULL), EINA_TRUE); 43 ck_assert_int_eq(efl_content_set(widget, NULL), EINA_TRUE);
44 ck_assert_int_eq(efl_alive_get(w), EINA_FALSE);
42 ck_assert_ptr_eq(efl_content_get(widget), NULL); 45 ck_assert_ptr_eq(efl_content_get(widget), NULL);
46
47 efl_del(widget);
43} 48}
44EFL_END_TEST 49EFL_END_TEST
45 50
@@ -49,8 +54,11 @@ EFL_START_TEST(content_unset)
49 Efl_Ui_Widget *w = create_test_widget(); 54 Efl_Ui_Widget *w = create_test_widget();
50 55
51 ck_assert_int_eq(efl_content_set(widget, w), EINA_TRUE); 56 ck_assert_int_eq(efl_content_set(widget, w), EINA_TRUE);
52 efl_content_unset(widget); 57 ck_assert_ptr_eq(efl_content_unset(widget), w);
53 ck_assert_ptr_eq(efl_content_get(widget), NULL); 58 ck_assert_ptr_eq(efl_content_get(widget), NULL);
59
60 efl_del(widget);
61 ck_assert_int_eq(efl_alive_get(w), EINA_TRUE);
54} 62}
55EFL_END_TEST 63EFL_END_TEST
56 64
diff --git a/src/tests/elementary/spec/efl_test_format.c b/src/tests/elementary/spec/efl_test_format.c
index c3fa7d4..7540829 100644
--- a/src/tests/elementary/spec/efl_test_format.c
+++ b/src/tests/elementary/spec/efl_test_format.c
@@ -24,7 +24,7 @@ EFL_START_TEST(format_values)
24 Eina_Strbuf *buf = eina_strbuf_new(); 24 Eina_Strbuf *buf = eina_strbuf_new();
25 Eina_Value eina_val; 25 Eina_Value eina_val;
26 26
27 efl_ui_format_values_set(widget, EINA_C_ARRAY_ACCESSOR_NEW(values)); 27 efl_ui_format_values_set(widget, EINA_C_ARRAY_ACCESSOR_PTR_NEW(values));
28 eina_val = eina_value_int_init(17); 28 eina_val = eina_value_int_init(17);
29 efl_ui_format_formatted_value_get(widget, buf, eina_val); 29 efl_ui_format_formatted_value_get(widget, buf, eina_val);
30 ck_assert_str_eq(eina_strbuf_string_get(buf), "seventeen"); // Check that value works 30 ck_assert_str_eq(eina_strbuf_string_get(buf), "seventeen"); // Check that value works
@@ -141,7 +141,7 @@ EFL_START_TEST(format_mixed)
141 141
142 // Now we check combinations of different options 142 // Now we check combinations of different options
143 // Each one should be used in turn when the previous one fails: values, func, string, fallback 143 // Each one should be used in turn when the previous one fails: values, func, string, fallback
144 efl_ui_format_values_set(widget, EINA_C_ARRAY_ACCESSOR_NEW(values)); 144 efl_ui_format_values_set(widget, EINA_C_ARRAY_ACCESSOR_PTR_NEW(values));
145 efl_ui_format_func_set(widget, NULL, _partial_format_func, NULL); 145 efl_ui_format_func_set(widget, NULL, _partial_format_func, NULL);
146 efl_ui_format_string_set(widget, "%d rabbits", EFL_UI_FORMAT_STRING_TYPE_SIMPLE); 146 efl_ui_format_string_set(widget, "%d rabbits", EFL_UI_FORMAT_STRING_TYPE_SIMPLE);
147 147
diff --git a/src/tests/elementary/spec/efl_test_gfx_view.c b/src/tests/elementary/spec/efl_test_gfx_view.c
index fc41113..e87419f 100644
--- a/src/tests/elementary/spec/efl_test_gfx_view.c
+++ b/src/tests/elementary/spec/efl_test_gfx_view.c
@@ -8,7 +8,7 @@
8 8
9/* spec-meta-start 9/* spec-meta-start
10 {"test-interface":"Efl.Gfx.View", 10 {"test-interface":"Efl.Gfx.View",
11 "test-widgets": ["Efl.Ui.Animation_View"]} 11 "test-widgets": ["Efl.Ui.Vg_Animation"]}
12 spec-meta-end */ 12 spec-meta-end */
13 13
14EFL_START_TEST(view_size) 14EFL_START_TEST(view_size)
diff --git a/src/tests/elementary/spec/efl_test_range_display.c b/src/tests/elementary/spec/efl_test_range_display.c
index f072e02..5704741 100644
--- a/src/tests/elementary/spec/efl_test_range_display.c
+++ b/src/tests/elementary/spec/efl_test_range_display.c
@@ -124,6 +124,10 @@ EFL_START_TEST (range_display_value_events)
124 changed = EINA_FALSE; 124 changed = EINA_FALSE;
125 min_reached = EINA_FALSE; 125 min_reached = EINA_FALSE;
126 max_reached = EINA_FALSE; 126 max_reached = EINA_FALSE;
127 efl_event_callback_del(widget, EFL_UI_RANGE_EVENT_CHANGED, _set_flag, &changed);
128 efl_event_callback_del(widget, EFL_UI_RANGE_EVENT_MIN_REACHED, _set_flag, &min_reached);
129 efl_event_callback_del(widget, EFL_UI_RANGE_EVENT_MAX_REACHED, _set_flag, &max_reached);
130
127} 131}
128EFL_END_TEST 132EFL_END_TEST
129 133
diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.c b/src/tests/elementary/spec/efl_ui_spec_suite.c
index d59072b..49ca5a9 100644
--- a/src/tests/elementary/spec/efl_ui_spec_suite.c
+++ b/src/tests/elementary/spec/efl_ui_spec_suite.c
@@ -13,8 +13,8 @@ Evas_Object *widget = NULL;
13Eo *collection_grid = NULL; 13Eo *collection_grid = NULL;
14const Efl_Class *test_content_klass = NULL; 14const Efl_Class *test_content_klass = NULL;
15const Efl_Class *widget_klass = NULL; 15const Efl_Class *widget_klass = NULL;
16EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS); 16EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "Efl.Ui.Widget", EFL_UI_WIDGET_CLASS);
17EFL_CLASS_SIMPLE_CLASS(efl_ui_item, "efl_ui_item", EFL_UI_ITEM_CLASS); 17EFL_CLASS_SIMPLE_CLASS(efl_ui_item, "Efl.Ui.Item", EFL_UI_ITEM_CLASS);
18#define EFL_UI_ITEM_REALIZED_CLASS efl_ui_item_realized_class_get() 18#define EFL_UI_ITEM_REALIZED_CLASS efl_ui_item_realized_class_get()
19 19
20 20