summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/ecore/efl_app_test_cml.eo2
-rw-r--r--src/tests/edje/edje_test_container.c2
-rw-r--r--src/tests/edje/edje_test_edje.c3
-rw-r--r--src/tests/edje/edje_test_features.c4
-rw-r--r--src/tests/edje/edje_test_signal.c9
-rw-r--r--src/tests/edje/edje_test_swallow.c2
-rw-r--r--src/tests/edje/edje_test_text.c30
-rw-r--r--src/tests/efl_mono/Eina.cs480
-rw-r--r--src/tests/efl_mono/Eo.cs66
-rw-r--r--src/tests/efl_mono/Evas.cs77
-rw-r--r--src/tests/efl_mono/StructHelpers.cs17
-rw-r--r--src/tests/efl_mono/Value.cs109
-rw-r--r--src/tests/efl_mono/dummy_child.eo32
-rw-r--r--src/tests/efl_mono/dummy_test_object.eo314
-rw-r--r--src/tests/efl_mono/efl-mono-suite.runtimeconfig.json10
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c57
-rw-r--r--src/tests/efl_mono/meson.build26
-rw-r--r--src/tests/eina/eina_test_convert.c95
-rw-r--r--src/tests/elementary/efl_ui_suite.c2
-rw-r--r--src/tests/elementary/efl_ui_suite.h2
-rw-r--r--src/tests/elementary/efl_ui_test_atspi.c61
-rw-r--r--src/tests/elementary/efl_ui_test_box.c67
-rw-r--r--src/tests/elementary/efl_ui_test_grid.c1
-rw-r--r--src/tests/elementary/efl_ui_test_image.c2
-rw-r--r--src/tests/elementary/efl_ui_test_image_zoomable.c2
-rw-r--r--src/tests/elementary/efl_ui_test_layout.c27
-rw-r--r--src/tests/elementary/efl_ui_test_relative_layout.c3
-rw-r--r--src/tests/elementary/efl_ui_test_table.c429
-rw-r--r--src/tests/elementary/efl_ui_test_widget.c182
-rw-r--r--src/tests/elementary/elm_code_test_syntax.c2
-rw-r--r--src/tests/elementary/elm_test_atspi.c60
-rw-r--r--src/tests/elementary/elm_test_box.c34
-rw-r--r--src/tests/elementary/elm_test_config.c1
-rw-r--r--src/tests/elementary/elm_test_gengrid.c51
-rw-r--r--src/tests/elementary/elm_test_genlist.c51
-rw-r--r--src/tests/elementary/elm_test_image.c1
-rw-r--r--src/tests/elementary/elm_test_layout.c13
-rw-r--r--src/tests/elementary/elm_test_spinner.c1
-rw-r--r--src/tests/elementary/meson.build2
-rw-r--r--src/tests/elementary/suite_helpers.c22
-rw-r--r--src/tests/elua/elua_lib.c48
-rw-r--r--src/tests/emotion/emotion_test_main-eo.c4
-rw-r--r--src/tests/eo/suite/meson.build14
-rw-r--r--src/tests/eolian/eolian_parsing.c4
-rw-r--r--src/tests/evas/evas_test_image.c4
-rw-r--r--src/tests/evas/evas_test_mask.c2
-rw-r--r--src/tests/evas/evas_test_mesh.c16
47 files changed, 1404 insertions, 1039 deletions
diff --git a/src/tests/ecore/efl_app_test_cml.eo b/src/tests/ecore/efl_app_test_cml.eo
index b0877e0..ade7426 100644
--- a/src/tests/ecore/efl_app_test_cml.eo
+++ b/src/tests/ecore/efl_app_test_cml.eo
@@ -1,4 +1,4 @@
1class Efl.App.Test.CML extends Efl.Object implements Efl.Core.Command_Line 1class @beta Efl.App.Test.CML extends Efl.Object implements Efl.Core.Command_Line
2{ 2{
3 3
4} 4}
diff --git a/src/tests/edje/edje_test_container.c b/src/tests/edje/edje_test_container.c
index 018de4d..11fc195 100644
--- a/src/tests/edje/edje_test_container.c
+++ b/src/tests/edje/edje_test_container.c
@@ -102,7 +102,7 @@ EFL_START_TEST(edje_test_box_eoapi)
102 fail_if(i != 3); 102 fail_if(i != 3);
103 eina_iterator_free(it); 103 eina_iterator_free(it);
104 104
105 fail_if(!efl_content_remove(efl_part(obj, "box"), sobjs[0])); 105 fail_if(!efl_pack_unpack(efl_part(obj, "box"), sobjs[0]));
106 fail_if(efl_content_count(efl_part(obj, "box")) != 2); 106 fail_if(efl_content_count(efl_part(obj, "box")) != 2);
107 fail_if(!efl_pack_unpack_at(efl_part(obj, "box"), 1)); 107 fail_if(!efl_pack_unpack_at(efl_part(obj, "box"), 1));
108 fail_if(efl_content_count(efl_part(obj, "box")) != 1); 108 fail_if(efl_content_count(efl_part(obj, "box")) != 1);
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index efe17e5..fb1e8e2 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -211,7 +211,8 @@ EFL_START_TEST(edje_test_part_caching)
211 Evas_Object *ly, *o1, *global_p = NULL; 211 Evas_Object *ly, *o1, *global_p = NULL;
212 212
213 ly = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 213 ly = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
214 efl_file_set(efl_added, test_layout_get("test_swallows.edj"), "test_group") 214 efl_file_set(efl_added, test_layout_get("test_swallows.edj")),
215 efl_file_key_set(efl_added, "test_group")
215 ); 216 );
216 217
217 for (int i = 0; i < 10; ++i) 218 for (int i = 0; i < 10; ++i)
diff --git a/src/tests/edje/edje_test_features.c b/src/tests/edje/edje_test_features.c
index 1cff283..449e97e 100644
--- a/src/tests/edje/edje_test_features.c
+++ b/src/tests/edje/edje_test_features.c
@@ -42,13 +42,13 @@ EFL_START_TEST(edje_test_masking)
42 edje_object_freeze(obj); 42 edje_object_freeze(obj);
43 sub = edje_object_part_object_get(obj, "text"); 43 sub = edje_object_part_object_get(obj, "text");
44 edje_object_thaw(obj); 44 edje_object_thaw(obj);
45 fail_if(!efl_canvas_object_clip_get(sub)); 45 fail_if(!efl_canvas_object_clipper_get(sub));
46 46
47 /* test description.clip_to override */ 47 /* test description.clip_to override */
48 edje_object_freeze(obj); 48 edje_object_freeze(obj);
49 sub = edje_object_part_object_get(obj, "noclip"); 49 sub = edje_object_part_object_get(obj, "noclip");
50 edje_object_thaw(obj); 50 edje_object_thaw(obj);
51 clip2 = efl_canvas_object_clip_get(sub); 51 clip2 = efl_canvas_object_clipper_get(sub);
52 fail_if(clip != clip2); 52 fail_if(clip != clip2);
53 53
54 evas_free(evas); 54 evas_free(evas);
diff --git a/src/tests/edje/edje_test_signal.c b/src/tests/edje/edje_test_signal.c
index 2dc42b0..20240a4 100644
--- a/src/tests/edje/edje_test_signal.c
+++ b/src/tests/edje/edje_test_signal.c
@@ -106,7 +106,8 @@ EFL_START_TEST(edje_test_message_send_eo)
106 evas = _setup_evas(); 106 evas = _setup_evas();
107 107
108 obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 108 obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
109 efl_file_set(efl_added, test_layout_get("test_messages.edj"), "test_group")); 109 efl_file_set(efl_added, test_layout_get("test_messages.edj")),
110 efl_file_key_set(efl_added, "test_group"));
110 111
111 // FIXME: EO API HERE 112 // FIXME: EO API HERE
112 edje_object_signal_callback_add(obj, "*", "edc", _message_signal_reply_cb, &id); 113 edje_object_signal_callback_add(obj, "*", "edc", _message_signal_reply_cb, &id);
@@ -163,7 +164,8 @@ EFL_START_TEST(edje_test_signals)
163 evas = _setup_evas(); 164 evas = _setup_evas();
164 165
165 obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 166 obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
166 efl_file_set(efl_added, test_layout_get("test_signals.edj"), "level1"), 167 efl_file_set(efl_added, test_layout_get("test_signals.edj")),
168 efl_file_key_set(efl_added, "level1"),
167 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(320, 240)), 169 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(320, 240)),
168 efl_gfx_entity_visible_set(efl_added, 1)); 170 efl_gfx_entity_visible_set(efl_added, 1));
169 171
@@ -207,7 +209,8 @@ EFL_START_TEST(edje_test_signal_callback_del_full)
207 209
208 obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 210 obj = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
209 efl_file_set(efl_added, 211 efl_file_set(efl_added,
210 test_layout_get("test_signal_callback_del_full.edj"), "test"), 212 test_layout_get("test_signal_callback_del_full.edj")),
213 efl_file_key_set(efl_added, "test"),
211 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(320, 240)), 214 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(320, 240)),
212 efl_gfx_entity_visible_set(efl_added, 1)); 215 efl_gfx_entity_visible_set(efl_added, 1));
213 216
diff --git a/src/tests/edje/edje_test_swallow.c b/src/tests/edje/edje_test_swallow.c
index 0d08951..b8f13cf 100644
--- a/src/tests/edje/edje_test_swallow.c
+++ b/src/tests/edje/edje_test_swallow.c
@@ -107,7 +107,7 @@ EFL_START_TEST(edje_test_swallows_eoapi)
107 fail_if(!efl_content_set(efl_part(ly, "swallow"), o1)); 107 fail_if(!efl_content_set(efl_part(ly, "swallow"), o1));
108 ck_assert_ptr_eq(efl_parent_get(o1), ly); 108 ck_assert_ptr_eq(efl_parent_get(o1), ly);
109 109
110 efl_content_remove(ly, o1); 110 efl_canvas_layout_content_remove(ly, o1);
111 ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1)); 111 ck_assert_ptr_eq(efl_parent_get(o1), evas_object_evas_get(o1));
112 112
113 fail_if(!efl_content_set(efl_part(ly, "swallow"), o1)); 113 fail_if(!efl_content_set(efl_part(ly, "swallow"), o1));
diff --git a/src/tests/edje/edje_test_text.c b/src/tests/edje/edje_test_text.c
index 96b33b5..86e1aaf 100644
--- a/src/tests/edje/edje_test_text.c
+++ b/src/tests/edje/edje_test_text.c
@@ -123,8 +123,9 @@ START_TEST(edje_test_text_ellipsis)
123 123
124 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 124 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
125 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); 125 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40)));
126 efl_file_set(layout, test_layout_get("test_text.edj"), "test"); 126 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
127 fail_if(efl_file_load_error_get(layout)); 127 efl_file_key_set(layout, "test");
128 ck_assert(!efl_file_load(layout));
128 129
129 efl_text_ellipsis_set(efl_part(layout, "text"), 1.0); 130 efl_text_ellipsis_set(efl_part(layout, "text"), 1.0);
130 131
@@ -141,8 +142,9 @@ START_TEST(edje_test_text_wrap)
141 142
142 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 143 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
143 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); 144 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40)));
144 efl_file_set(layout, test_layout_get("test_text.edj"), "test"); 145 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
145 fail_if(efl_file_load_error_get(layout)); 146 efl_file_key_set(layout, "test");
147 ck_assert(!efl_file_load(layout));
146 148
147 efl_text_wrap_set(efl_part(layout, "text"), EFL_TEXT_FORMAT_WRAP_WORD); 149 efl_text_wrap_set(efl_part(layout, "text"), EFL_TEXT_FORMAT_WRAP_WORD);
148 150
@@ -159,8 +161,9 @@ START_TEST(edje_test_text_font)
159 161
160 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 162 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
161 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); 163 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40)));
162 efl_file_set(layout, test_layout_get("test_text.edj"), "test"); 164 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
163 fail_if(efl_file_load_error_get(layout)); 165 efl_file_key_set(layout, "test");
166 ck_assert(!efl_file_load(layout));
164 167
165 efl_text_font_set(efl_part(layout, "text"), "Sans", 14); 168 efl_text_font_set(efl_part(layout, "text"), "Sans", 14);
166 169
@@ -177,8 +180,9 @@ START_TEST(edje_test_text_color)
177 180
178 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 181 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
179 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); 182 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40)));
180 efl_file_set(layout, test_layout_get("test_text.edj"), "test"); 183 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
181 fail_if(efl_file_load_error_get(layout)); 184 efl_file_key_set(layout, "test");
185 ck_assert(!efl_file_load(layout));
182 186
183 efl_text_normal_color_set(efl_part(layout, "text"), 255, 255, 255, 255); 187 efl_text_normal_color_set(efl_part(layout, "text"), 255, 255, 255, 255);
184 188
@@ -315,13 +319,15 @@ START_TEST(edje_test_text_part)
315 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas, 319 layout = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas,
316 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40))); 320 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 40)));
317 321
318 efl_file_set(layout, test_layout_get("test_text.edj"), "test"); 322 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
319 fail_if(efl_file_load_error_get(layout)); 323 efl_file_key_set(layout, "test");
324 ck_assert(!efl_file_load(layout));
320 _basic_check(layout, EINA_TRUE); 325 _basic_check(layout, EINA_TRUE);
321 326
322 // Load again and check persistance 327 // Load again and check persistance
323 efl_file_set(layout, test_layout_get("test_text.edj"), "test2"); 328 ck_assert(!efl_file_set(layout, test_layout_get("test_text.edj")));
324 fail_if(efl_file_load_error_get(layout)); 329 efl_file_key_set(layout, "test2");
330 ck_assert(!efl_file_load(layout));
325 _basic_check(layout, EINA_FALSE); 331 _basic_check(layout, EINA_FALSE);
326 332
327 evas_free(evas); 333 evas_free(evas);
diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs
index 1009252..8b7f1a9 100644
--- a/src/tests/efl_mono/Eina.cs
+++ b/src/tests/efl_mono/Eina.cs
@@ -1263,251 +1263,6 @@ class TestEinaInarray
1263 arr.Dispose(); 1263 arr.Dispose();
1264 } 1264 }
1265 1265
1266 // //
1267 // Code Generation
1268 //
1269
1270 // Integer //
1271
1272 public static void test_eina_inarray_int_in()
1273 {
1274 var t = new Dummy.TestObject();
1275 var arr = new Eina.Inarray<int>();
1276 arr.Append(base_seq_int);
1277 Test.Assert(t.EinaInarrayIntIn(arr));
1278 Test.Assert(arr.Own);
1279 Test.Assert(arr.ToArray().SequenceEqual(modified_seq_int));
1280 arr.Dispose();
1281 Test.Assert(arr.Handle == IntPtr.Zero);
1282 }
1283
1284 public static void test_eina_inarray_int_in_own()
1285 {
1286 var t = new Dummy.TestObject();
1287 var arr = new Eina.Inarray<int>();
1288 arr.Append(base_seq_int);
1289 Test.Assert(t.EinaInarrayIntInOwn(arr));
1290 Test.Assert(!arr.Own);
1291 Test.Assert(arr.ToArray().SequenceEqual(modified_seq_int));
1292 arr.Dispose();
1293 Test.Assert(arr.Handle == IntPtr.Zero);
1294 Test.Assert(t.CheckEinaInarrayIntInOwn());
1295 }
1296
1297 public static void test_eina_inarray_int_out()
1298 {
1299 var t = new Dummy.TestObject();
1300 Eina.Inarray<int> arr;
1301 Test.Assert(t.EinaInarrayIntOut(out arr));
1302 Test.Assert(!arr.Own);
1303 Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
1304 Test.Assert(arr.Append(append_seq_int));
1305 arr.Dispose();
1306 Test.Assert(arr.Handle == IntPtr.Zero);
1307 Test.Assert(t.CheckEinaInarrayIntOut());
1308 }
1309
1310 public static void test_eina_inarray_int_out_own()
1311 {
1312 var t = new Dummy.TestObject();
1313 Eina.Inarray<int> arr;
1314 Test.Assert(t.EinaInarrayIntOutOwn(out arr));
1315 Test.Assert(arr.Own);
1316 Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
1317 Test.Assert(arr.Append(append_seq_int));
1318 arr.Dispose();
1319 Test.Assert(arr.Handle == IntPtr.Zero);
1320 }
1321
1322 public static void test_eina_inarray_int_return()
1323 {
1324 var t = new Dummy.TestObject();
1325 var arr = t.EinaInarrayIntReturn();
1326 Test.Assert(!arr.Own);
1327 Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
1328 Test.Assert(arr.Append(append_seq_int));
1329 arr.Dispose();
1330 Test.Assert(arr.Handle == IntPtr.Zero);
1331 Test.Assert(t.CheckEinaInarrayIntReturn());
1332 }
1333
1334 public static void test_eina_inarray_int_return_own()
1335 {
1336 var t = new Dummy.TestObject();
1337 var arr = t.EinaInarrayIntReturnOwn();
1338 Test.Assert(arr.Own);
1339 Test.Assert(arr.ToArray().SequenceEqual(base_seq_int));
1340 Test.Assert(arr.Append(append_seq_int));
1341 arr.Dispose();
1342 Test.Assert(arr.Handle == IntPtr.Zero);
1343 }
1344
1345 // String //
1346 public static void test_eina_inarray_str_in()
1347 {
1348 var t = new Dummy.TestObject();
1349 var arr = new Eina.Inarray<string>();
1350 arr.Append(base_seq_str);
1351 Test.Assert(t.EinaInarrayStrIn(arr));
1352 Test.Assert(arr.Own);
1353 Test.Assert(arr.ToArray().SequenceEqual(modified_seq_str));
1354 arr.Dispose();
1355 Test.Assert(arr.Handle == IntPtr.Zero);
1356 }
1357
1358 public static void test_eina_inarray_str_in_own()
1359 {
1360 var t = new Dummy.TestObject();
1361 var arr = new Eina.Inarray<string>();
1362 arr.Append(base_seq_str);
1363 Test.Assert(t.EinaInarrayStrInOwn(arr));
1364 Test.Assert(!arr.Own);
1365 Test.Assert(arr.ToArray().SequenceEqual(modified_seq_str));
1366 arr.Dispose();
1367 Test.Assert(arr.Handle == IntPtr.Zero);
1368 Test.Assert(t.CheckEinaInarrayStrInOwn());
1369 }
1370
1371 public static void test_eina_inarray_str_out()
1372 {
1373 var t = new Dummy.TestObject();
1374 Eina.Inarray<string> arr;
1375 Test.Assert(t.EinaInarrayStrOut(out arr));
1376 Test.Assert(!arr.Own);
1377 Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
1378 Test.Assert(arr.Append(append_seq_str));
1379 arr.Dispose();
1380 Test.Assert(arr.Handle == IntPtr.Zero);
1381 Test.Assert(t.CheckEinaInarrayStrOut());
1382 }
1383
1384 public static void test_eina_inarray_str_out_own()
1385 {
1386 var t = new Dummy.TestObject();
1387 Eina.Inarray<string> arr;
1388 Test.Assert(t.EinaInarrayStrOutOwn(out arr));
1389 Test.Assert(arr.Own);
1390 Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
1391 Test.Assert(arr.Append(append_seq_str));
1392 arr.Dispose();
1393 Test.Assert(arr.Handle == IntPtr.Zero);
1394 }
1395
1396 public static void test_eina_inarray_str_return()
1397 {
1398 var t = new Dummy.TestObject();
1399 var arr = t.EinaInarrayStrReturn();
1400 Test.Assert(!arr.Own);
1401 Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
1402 Test.Assert(arr.Append(append_seq_str));
1403 arr.Dispose();
1404 Test.Assert(arr.Handle == IntPtr.Zero);
1405 Test.Assert(t.CheckEinaInarrayStrReturn());
1406 }
1407
1408 public static void test_eina_inarray_str_return_own()
1409 {
1410 var t = new Dummy.TestObject();
1411 var arr = t.EinaInarrayStrReturnOwn();
1412 Test.Assert(arr.Own);
1413 Test.Assert(arr.ToArray().SequenceEqual(base_seq_str));
1414 Test.Assert(arr.Append(append_seq_str));
1415 arr.Dispose();
1416 Test.Assert(arr.Handle == IntPtr.Zero);
1417 }
1418
1419 // Object //
1420
1421 public static void test_eina_inarray_obj_in()
1422 {
1423 var t = new Dummy.TestObject();
1424 var arr = new Eina.Inarray<Dummy.Numberwrapper>();
1425 arr.Append(BaseSeqObj());
1426 Test.Assert(t.EinaInarrayObjIn(arr));
1427 Test.Assert(arr.Own);
1428 NumberwrapperSequenceAssertEqual(arr.ToArray(), ModifiedSeqObj());
1429 arr.Dispose();
1430 Test.Assert(arr.Handle == IntPtr.Zero);
1431 }
1432
1433 public static void test_eina_inarray_obj_in_own()
1434 {
1435 var t = new Dummy.TestObject();
1436 var arr = new Eina.Inarray<Dummy.Numberwrapper>();
1437 arr.Append(BaseSeqObj());
1438 Test.Assert(t.EinaInarrayObjInOwn(arr));
1439 Test.Assert(!arr.Own);
1440 NumberwrapperSequenceAssertEqual(arr.ToArray(), ModifiedSeqObj());
1441 arr.Dispose();
1442 Test.Assert(arr.Handle == IntPtr.Zero);
1443 Test.Assert(t.CheckEinaInarrayObjInOwn());
1444 }
1445
1446 public static void test_eina_inarray_obj_out()
1447 {
1448 var t = new Dummy.TestObject();
1449 Eina.Inarray<Dummy.Numberwrapper> arr;
1450 Test.Assert(t.EinaInarrayObjOut(out arr));
1451 Test.Assert(!arr.Own);
1452 NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
1453 Test.Assert(arr.Append(AppendSeqObj()));
1454 arr.Dispose();
1455 Test.Assert(arr.Handle == IntPtr.Zero);
1456 Test.Assert(t.CheckEinaInarrayObjOut());
1457 }
1458
1459 public static void test_eina_inarray_obj_out_own()
1460 {
1461 var t = new Dummy.TestObject();
1462 Eina.Inarray<Dummy.Numberwrapper> arr;
1463 Test.Assert(t.EinaInarrayObjOutOwn(out arr));
1464 Test.Assert(arr.Own);
1465 NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
1466 Test.Assert(arr.Append(AppendSeqObj()));
1467 arr.Dispose();
1468 Test.Assert(arr.Handle == IntPtr.Zero);
1469 }
1470
1471 public static void test_eina_inarray_obj_return()
1472 {
1473 var t = new Dummy.TestObject();
1474 var arr = t.EinaInarrayObjReturn();
1475 Test.Assert(!arr.Own);
1476 NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
1477 Test.Assert(arr.Append(AppendSeqObj()));
1478 arr.Dispose();
1479 Test.Assert(arr.Handle == IntPtr.Zero);
1480 Test.Assert(t.CheckEinaInarrayObjReturn());
1481 }
1482
1483 public static void test_eina_inarray_obj_return_own()
1484 {
1485 var t = new Dummy.TestObject();
1486 var arr = t.EinaInarrayObjReturnOwn();
1487 Test.Assert(arr.Own);
1488 NumberwrapperSequenceAssertEqual(arr.ToArray(), BaseSeqObj());
1489 Test.Assert(arr.Append(AppendSeqObj()));
1490 arr.Dispose();
1491 Test.Assert(arr.Handle == IntPtr.Zero);
1492 }
1493
1494 public static void test_eina_inarray_obj_return_in_same_id()
1495 {
1496 var t = new Dummy.TestObject();
1497 var cmp = BaseSeqObj();
1498 var a = new Eina.Inarray<Dummy.Numberwrapper>();
1499 a.Append(cmp);
1500 var b = t.EinaInarrayObjReturnIn(a);
1501 NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray());
1502 NumberwrapperSequenceAssertEqual(a.ToArray(), BaseSeqObj());
1503 int len = a.Length;
1504 for (int i=0; i < len; ++i)
1505 {
1506 Test.Assert(a[i].NativeHandle == b[i].NativeHandle);
1507 Test.Assert(a[i].NativeHandle == cmp[i].NativeHandle);
1508 }
1509 a.Dispose();
1510 }
1511} 1266}
1512 1267
1513class TestEinaList 1268class TestEinaList
@@ -2323,241 +2078,6 @@ class TestEinaInlist
2323 } 2078 }
2324 } 2079 }
2325 2080
2326 // //
2327 // Code Generation
2328 //
2329
2330 // Integer //
2331
2332 public static void test_eina_inlist_int_in()
2333 {
2334 var t = new Dummy.TestObject();
2335 var lst = new Eina.Inlist<int>();
2336 lst.AppendArray(base_seq_int);
2337 Test.Assert(t.EinaInlistIntIn(lst));
2338 Test.Assert(lst.Own);
2339 Test.Assert(lst.ToArray().SequenceEqual(base_seq_int));
2340 lst.Dispose();
2341 Test.Assert(lst.Handle == IntPtr.Zero);
2342 }
2343
2344 public static void test_eina_inlist_int_in_own()
2345 {
2346 var t = new Dummy.TestObject();
2347 var lst = new Eina.Inlist<int>();
2348 lst.AppendArray(base_seq_int);
2349 Test.Assert(t.EinaInlistIntInOwn(lst));
2350 Test.Assert(!lst.Own);
2351 lst.Dispose();
2352 Test.Assert(lst.Handle == IntPtr.Zero);
2353 Test.Assert(t.CheckEinaInlistIntInOwn());
2354 }
2355
2356 public static void test_eina_inlist_int_out()
2357 {
2358 var t = new Dummy.TestObject();
2359 Eina.Inlist<int> lst;
2360 Test.Assert(t.EinaInlistIntOut(out lst));
2361 Test.Assert(!lst.Own);
2362 Test.Assert(lst.ToArray().SequenceEqual(base_seq_int));
2363 lst.Dispose();
2364 Test.Assert(lst.Handle == IntPtr.Zero);
2365 Test.Assert(t.CheckEinaInlistIntOut());
2366 }
2367
2368 public static void test_eina_inlist_int_out_own()
2369 {
2370 var t = new Dummy.TestObject();
2371 Eina.Inlist<int> lst;
2372 Test.Assert(t.EinaInlistIntOutOwn(out lst));
2373 Test.Assert(lst.Own);
2374 Test.Assert(lst.ToArray().SequenceEqual(base_seq_int));
2375 lst.AppendArray(append_seq_int);
2376 lst.Dispose();
2377 Test.Assert(lst.Handle == IntPtr.Zero);
2378 }
2379
2380 public static void test_eina_inlist_int_return()
2381 {
2382 var t = new Dummy.TestObject();
2383 var lst = t.EinaInlistIntReturn();
2384 Test.Assert(!lst.Own);
2385 Test.Assert(lst.ToArray().SequenceEqual(base_seq_int));
2386 lst.Dispose();
2387 Test.Assert(lst.Handle == IntPtr.Zero);
2388 Test.Assert(t.CheckEinaInlistIntReturn());
2389 }
2390
2391 public static void test_eina_inlist_int_return_own()
2392 {
2393 var t = new Dummy.TestObject();
2394 var lst = t.EinaInlistIntReturnOwn();
2395 Test.Assert(lst.Own);
2396 Test.Assert(lst.ToArray().SequenceEqual(base_seq_int));
2397 lst.AppendArray(append_seq_int);
2398 lst.Dispose();
2399 Test.Assert(lst.Handle == IntPtr.Zero);
2400 }
2401
2402 // String //
2403 public static void test_eina_inlist_str_in()
2404 {
2405 var t = new Dummy.TestObject();
2406 var lst = new Eina.Inlist<string>();
2407 lst.AppendArray(base_seq_str);
2408 Test.Assert(t.EinaInlistStrIn(lst));
2409 Test.Assert(lst.Own);
2410 Test.Assert(lst.ToArray().SequenceEqual(base_seq_str));
2411 lst.Dispose();
2412 Test.Assert(lst.Handle == IntPtr.Zero);
2413 }
2414
2415 public static void test_eina_inlist_str_in_own()
2416 {
2417 var t = new Dummy.TestObject();
2418 var lst = new Eina.Inlist<string>();
2419 lst.AppendArray(base_seq_str);
2420 Test.Assert(t.EinaInlistStrInOwn(lst));
2421 Test.Assert(!lst.Own);
2422 lst.Dispose();
2423 Test.Assert(lst.Handle == IntPtr.Zero);
2424 Test.Assert(t.CheckEinaInlistStrInOwn());
2425 }
2426
2427 public static void test_eina_inlist_str_out()
2428 {
2429 var t = new Dummy.TestObject();
2430 Eina.Inlist<string> lst;
2431 Test.Assert(t.EinaInlistStrOut(out lst));
2432 Test.Assert(!lst.Own);
2433 Test.Assert(lst.ToArray().SequenceEqual(base_seq_str));
2434 lst.Dispose();
2435 Test.Assert(lst.Handle == IntPtr.Zero);
2436 Test.Assert(t.CheckEinaInlistStrOut());
2437 }
2438
2439 public static void test_eina_inlist_str_out_own()
2440 {
2441 var t = new Dummy.TestObject();
2442 Eina.Inlist<string> lst;
2443 Test.Assert(t.EinaInlistStrOutOwn(out lst));
2444 Test.Assert(lst.Own);
2445 Test.Assert(lst.ToArray().SequenceEqual(base_seq_str));
2446 lst.AppendArray(append_seq_str);
2447 lst.Dispose();
2448 Test.Assert(lst.Handle == IntPtr.Zero);
2449 }
2450
2451 public static void test_eina_inlist_str_return()
2452 {
2453 var t = new Dummy.TestObject();
2454 var lst = t.EinaInlistStrReturn();
2455 Test.Assert(!lst.Own);
2456 Test.Assert(lst.ToArray().SequenceEqual(base_seq_str));
2457 lst.Dispose();
2458 Test.Assert(lst.Handle == IntPtr.Zero);
2459 Test.Assert(t.CheckEinaInlistStrReturn());
2460 }
2461
2462 public static void test_eina_inlist_str_return_own()
2463 {
2464 var t = new Dummy.TestObject();
2465 var lst = t.EinaInlistStrReturnOwn();
2466 Test.Assert(lst.Own);
2467 Test.Assert(lst.ToArray().SequenceEqual(base_seq_str));
2468 lst.AppendArray(append_seq_str);
2469 lst.Dispose();
2470 Test.Assert(lst.Handle == IntPtr.Zero);
2471 }
2472
2473 // Object //
2474
2475 public static void test_eina_inlist_obj_in()
2476 {
2477 var t = new Dummy.TestObject();
2478 var lst = new Eina.Inlist<Dummy.Numberwrapper>();
2479 lst.AppendArray(BaseSeqObj());
2480 Test.Assert(t.EinaInlistObjIn(lst));
2481 Test.Assert(lst.Own);
2482 NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
2483 lst.Dispose();
2484 Test.Assert(lst.Handle == IntPtr.Zero);
2485 }
2486
2487 public static void test_eina_inlist_obj_in_own()
2488 {
2489 var t = new Dummy.TestObject();
2490 var lst = new Eina.Inlist<Dummy.Numberwrapper>();
2491 lst.AppendArray(BaseSeqObj());
2492 Test.Assert(t.EinaInlistObjInOwn(lst));
2493 Test.Assert(!lst.Own);
2494 lst.Dispose();
2495 Test.Assert(lst.Handle == IntPtr.Zero);
2496 Test.Assert(t.CheckEinaInlistObjInOwn());
2497 }
2498
2499 public static void test_eina_inlist_obj_out()
2500 {
2501 var t = new Dummy.TestObject();
2502 Eina.Inlist<Dummy.Numberwrapper> lst;
2503 Test.Assert(t.EinaInlistObjOut(out lst));
2504 Test.Assert(!lst.Own);
2505 NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
2506 lst.Dispose();
2507 Test.Assert(lst.Handle == IntPtr.Zero);
2508 Test.Assert(t.CheckEinaInlistObjOut());
2509 }
2510
2511 public static void test_eina_inlist_obj_out_own()
2512 {
2513 var t = new Dummy.TestObject();
2514 Eina.Inlist<Dummy.Numberwrapper> lst;
2515 Test.Assert(t.EinaInlistObjOutOwn(out lst));
2516 Test.Assert(lst.Own);
2517 NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
2518 lst.AppendArray(AppendSeqObj());
2519 lst.Dispose();
2520 Test.Assert(lst.Handle == IntPtr.Zero);
2521 }
2522
2523 public static void test_eina_inlist_obj_return()
2524 {
2525 var t = new Dummy.TestObject();
2526 var lst = t.EinaInlistObjReturn();
2527 Test.Assert(!lst.Own);
2528 NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
2529 lst.Dispose();
2530 Test.Assert(lst.Handle == IntPtr.Zero);
2531 Test.Assert(t.CheckEinaInlistObjReturn());
2532 }
2533
2534 public static void test_eina_inlist_obj_return_own()
2535 {
2536 var t = new Dummy.TestObject();
2537 var lst = t.EinaInlistObjReturnOwn();
2538 Test.Assert(lst.Own);
2539 NumberwrapperSequenceAssertEqual(lst.ToArray(), BaseSeqObj());
2540 lst.AppendArray(AppendSeqObj());
2541 lst.Dispose();
2542 Test.Assert(lst.Handle == IntPtr.Zero);
2543 }
2544
2545 public static void test_eina_inlist_obj_return_in_same_id()
2546 {
2547 var t = new Dummy.TestObject();
2548 var cmp = BaseSeqObj();
2549 var a = new Eina.Inlist<Dummy.Numberwrapper>();
2550 a.AppendArray(cmp);
2551 var b = t.EinaInlistObjReturnIn(a);
2552 NumberwrapperSequenceAssertEqual(a.ToArray(), b.ToArray());
2553 NumberwrapperSequenceAssertEqual(a.ToArray(), BaseSeqObj());
2554 int len = a.Length;
2555 for (int i=0; i < len; ++i)
2556 {
2557 Test.Assert(a[i].NativeHandle == b[i].NativeHandle);
2558 Test.Assert(a[i].NativeHandle == cmp[i].NativeHandle);
2559 }
2560 }
2561} // < TestEinaInlist 2081} // < TestEinaInlist
2562 2082
2563 2083
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index ed1d65a..08c5e2d 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -10,6 +10,13 @@ class TestEo
10 { 10 {
11 } 11 }
12 12
13 public static void return_null_object()
14 {
15 var testing = new Dummy.TestObject();
16 var o1 = testing.ReturnNullObject();
17 Test.Assert(o1 == null);
18 }
19
13 // 20 //
14 // Test cases: 21 // Test cases:
15 // 22 //
@@ -190,6 +197,24 @@ class TestTypedefs
190 } 197 }
191} 198}
192 199
200class TestVariables
201{
202 public static void test_constant_variables()
203 {
204 Test.AssertEquals(Dummy.Constants.ConstvarBool, true);
205 Test.AssertEquals(Dummy.Constants.ConstvarInt, -32766);
206 Test.AssertEquals(Dummy.Constants.ConstvarUInt, 65533U);
207 Test.AssertEquals(Dummy.Constants.ConstvarLong, -2147483644L);
208 Test.AssertEquals(Dummy.Constants.ConstvarULong, 4294967288UL);
209 Test.AssertEquals(Dummy.Constants.ConstvarLLong, -9223372036854775800);
210 Test.AssertEquals(Dummy.Constants.ConstvarULLong, 18446744073709551615);
211 Test.AssertEquals(Dummy.Constants.ConstvarFloat, 16777211.0f);
212 Test.AssertEquals(Dummy.Constants.ConstvarDouble, 9007199254740988.0);
213 Test.AssertEquals(Dummy.Constants.ConstvarChar, '!');
214 Test.AssertEquals(Dummy.Constants.ConstvarString, "test_str");
215 }
216}
217
193class TestEoAccessors 218class TestEoAccessors
194{ 219{
195 public static void basic_eo_accessors() 220 public static void basic_eo_accessors()
@@ -329,7 +354,11 @@ class TestEoGrandChildrenFinalize
329 public sealed class GrandChild : Dummy.Child 354 public sealed class GrandChild : Dummy.Child
330 { 355 {
331 356
357#if EFL_BETA
358 public GrandChild() : base(null, "", 0.0, 0) { }
359#else
332 public GrandChild() : base(null, "", 0.0) { } 360 public GrandChild() : base(null, "", 0.0) { }
361#endif
333 362
334 public int receivedValue = 0; 363 public int receivedValue = 0;
335 public override Efl.Object FinalizeAdd() 364 public override Efl.Object FinalizeAdd()
@@ -353,18 +382,43 @@ class TestConstructors
353 int iface_prop = 42; 382 int iface_prop = 42;
354 string a = "LFE"; 383 string a = "LFE";
355 double b = 3.14; 384 double b = 3.14;
385#if EFL_BETA
386 int beta = 1337;
387#endif
388
389#if EFL_BETA
390 var obj = new Dummy.Child(null, a, b, beta, iface_prop, 0);
391#else
356 var obj = new Dummy.Child(null, a, b, iface_prop); 392 var obj = new Dummy.Child(null, a, b, iface_prop);
393#endif
357 Test.AssertEquals(iface_prop, obj.IfaceProp); 394 Test.AssertEquals(iface_prop, obj.IfaceProp);
358 395
396#if EFL_BETA
397 obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b,
398 obligatoryBetaCtor : beta,
399 optionalBetaCtor : -beta);
400#else
359 obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b); 401 obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b);
402#endif
360 Test.AssertEquals(iface_prop, obj.IfaceProp); 403 Test.AssertEquals(iface_prop, obj.IfaceProp);
404
405#if EFL_BETA
406 Test.Assert(obj.ObligatoryBetaCtorWasCalled);
407 Test.Assert(obj.OptionalBetaCtorWasCalled);
408#endif
361 } 409 }
362 410
363 public static void test_optional_constructor() 411 public static void test_optional_constructor()
364 { 412 {
365 string a = "LFE"; 413 string a = "LFE";
366 double b = 3.14; 414 double b = 3.14;
415#if EFL_BETA
416 int beta = 2241;
417 var obj = new Dummy.Child(null, a, b, obligatoryBetaCtor : beta);
418 Test.Assert(!obj.OptionalBetaCtorWasCalled);
419#else
367 var obj = new Dummy.Child(null, a, b); 420 var obj = new Dummy.Child(null, a, b);
421#endif
368 Test.Assert(!obj.GetIfaceWasSet()); 422 Test.Assert(!obj.GetIfaceWasSet());
369 } 423 }
370} 424}
@@ -382,4 +436,16 @@ class TestInterfaceConcrete
382 } 436 }
383} 437}
384 438
439class TestProvider
440{
441 public static void test_find_provider()
442 {
443 // Tests only the direction C# -> C
444 var obj = new Dummy.TestObject();
445 Dummy.Numberwrapper provider = Dummy.Numberwrapper.static_cast(obj.FindProvider(typeof(Dummy.Numberwrapper)));
446 Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper));
447 Test.AssertEquals(provider.GetNumber(), 1999);
448 }
449}
450
385} 451}
diff --git a/src/tests/efl_mono/Evas.cs b/src/tests/efl_mono/Evas.cs
deleted file mode 100644
index 6d40412..0000000
--- a/src/tests/efl_mono/Evas.cs
+++ /dev/null
@@ -1,77 +0,0 @@
1using System;
2using System.Runtime.InteropServices;
3using System.Runtime.CompilerServices;
4
5public class MyBox : Evas.Box
6{
7 public MyBox(Efl.Object parent) : base(parent) {}
8
9 [DllImport("evas")] static extern void evas_obj_box_layout_vertical(IntPtr obj, IntPtr data, IntPtr privdata);
10 [DllImport("evas")] static extern void evas_obj_box_layout_horizontal(IntPtr obj, IntPtr data, IntPtr privdata);
11 [DllImport("evas")] static extern void evas_object_box_layout_horizontal(IntPtr obj, IntPtr data, IntPtr privdata);
12 [DllImport("evas")] static extern IntPtr evas_object_evas_get(IntPtr obj);
13 [DllImport("evas")] static extern void evas_event_freeze(IntPtr obj);
14 [DllImport("evas")] static extern void evas_event_thaw(IntPtr obj);
15
16 override public void CalculateGroup()
17 {
18 IntPtr evas = evas_object_evas_get(NativeHandle);
19 evas_event_freeze(evas);
20 Eina.Log.Debug("called group_calculate");
21 // slayouting_set(true);
22 evas_obj_box_layout_vertical(NativeHandle, IntPtr.Zero, IntPtr.Zero);
23 // layouting_set(false);
24 // children_changed_set(false);
25 evas_event_thaw(evas);
26 }
27}
28
29namespace TestSuite
30{
31
32class TestEvas
33{
34 /* private static string ImagePath([CallerFilePath] string folder="") */
35 /* { */
36 /* return System.IO.Path.GetDirectoryName(folder); */
37 /* } */
38
39 /* public static void simple_layout() */
40 /* { */
41/* // efl.Loop loop = new efl.LoopConcrete(); */
42
43 /* EcoreEvas ecore_evas = new EcoreEvas(); */
44
45 /* efl.canvas.Object canvas = ecore_evas.canvas; */
46 /* canvas.visible_set(true); */
47
48 /* efl.Object parent = canvas.parent_get(); */
49 /* Test.Assert(parent.NativeHandle != IntPtr.Zero); */
50
51 /* efl.canvas.Rectangle rect = new efl.canvas.RectangleConcrete(canvas); */
52 /* rect.color_set(255, 255, 255, 255); */
53 /* rect.size_set(640, 480); */
54 /* rect.visible_set(true); */
55
56 /* evas.Box box = new MyBox(canvas); */
57 /* rect.size_set(320, 240); */
58 /* box.visible_set(true); */
59
60 /* efl.canvas.Image image1 = new efl.canvas.ImageConcrete(canvas); */
61 /* image1.file_set(ImagePath() + "/../../examples/elementary/sphere_hunter/score.jpg", ""); */
62 /* image1.hint_min_set(160, 240); */
63 /* image1.visible_set(true); */
64
65 /* efl.canvas.Image image2 = new efl.canvas.ImageConcrete(canvas); */
66 /* image2.file_set(ImagePath() + "/../../examples/evas/shooter/assets/images/bricks.jpg", ""); */
67 /* image2.hint_min_set(160, 120); */
68 /* image2.visible_set(true); */
69
70 /* box.append(image1); */
71 /* box.append(image2); */
72
73/* // loop.begin(); */
74 /* } */
75}
76
77}
diff --git a/src/tests/efl_mono/StructHelpers.cs b/src/tests/efl_mono/StructHelpers.cs
index 1b05a07..4debea5 100644
--- a/src/tests/efl_mono/StructHelpers.cs
+++ b/src/tests/efl_mono/StructHelpers.cs
@@ -129,22 +129,11 @@ internal class StructHelpers
129 complex.Farray.Push(0x2A); 129 complex.Farray.Push(0x2A);
130 complex.Farray.Push(0x42); 130 complex.Farray.Push(0x42);
131 131
132 complex.Finarray = new Eina.Inarray<int>();
133 complex.Finarray.Push(0x0);
134 complex.Finarray.Push(0x2A);
135 complex.Finarray.Push(0x42);
136
137
138 complex.Flist = new Eina.List<string>(); 132 complex.Flist = new Eina.List<string>();
139 complex.Flist.Append("0x0"); 133 complex.Flist.Append("0x0");
140 complex.Flist.Append("0x2A"); 134 complex.Flist.Append("0x2A");
141 complex.Flist.Append("0x42"); 135 complex.Flist.Append("0x42");
142 136
143 complex.Finlist = new Eina.Inlist<int>();
144 complex.Finlist.Append(0x0);
145 complex.Finlist.Append(0x2A);
146 complex.Finlist.Append(0x42);
147
148 complex.Fhash = new Eina.Hash<string, string>(); 137 complex.Fhash = new Eina.Hash<string, string>();
149 complex.Fhash["aa"] = "aaa"; 138 complex.Fhash["aa"] = "aaa";
150 complex.Fhash["bb"] = "bbb"; 139 complex.Fhash["bb"] = "bbb";
@@ -175,12 +164,8 @@ internal class StructHelpers
175 { 164 {
176 Test.Assert(complex.Farray.ToArray().SequenceEqual(base_seq_int)); 165 Test.Assert(complex.Farray.ToArray().SequenceEqual(base_seq_int));
177 166
178 Test.Assert(complex.Finarray.ToArray().SequenceEqual(base_seq_int));
179
180 Test.Assert(complex.Flist.ToArray().SequenceEqual(base_seq_str)); 167 Test.Assert(complex.Flist.ToArray().SequenceEqual(base_seq_str));
181 168
182 Test.Assert(complex.Finlist.ToArray().SequenceEqual(base_seq_int));
183
184 Test.Assert(complex.Fhash["aa"] == "aaa"); 169 Test.Assert(complex.Fhash["aa"] == "aaa");
185 Test.Assert(complex.Fhash["bb"] == "bbb"); 170 Test.Assert(complex.Fhash["bb"] == "bbb");
186 Test.Assert(complex.Fhash["cc"] == "ccc"); 171 Test.Assert(complex.Fhash["cc"] == "ccc");
@@ -214,9 +199,7 @@ internal class StructHelpers
214 internal static void checkZeroedStructComplex(Dummy.StructComplex complex) 199 internal static void checkZeroedStructComplex(Dummy.StructComplex complex)
215 { 200 {
216 Test.Assert(complex.Farray == null); 201 Test.Assert(complex.Farray == null);
217 Test.Assert(complex.Finarray == null);
218 Test.Assert(complex.Flist == null); 202 Test.Assert(complex.Flist == null);
219 Test.Assert(complex.Finlist == null);
220 Test.Assert(complex.Fhash == null); 203 Test.Assert(complex.Fhash == null);
221 Test.Assert(complex.Fiterator == null); 204 Test.Assert(complex.Fiterator == null);
222 Test.Assert(complex.Fany_value == null); 205 Test.Assert(complex.Fany_value == null);
diff --git a/src/tests/efl_mono/Value.cs b/src/tests/efl_mono/Value.cs
index 6f2c579..2c5e311 100644
--- a/src/tests/efl_mono/Value.cs
+++ b/src/tests/efl_mono/Value.cs
@@ -604,7 +604,74 @@ public static class TestEinaValue {
604 } 604 }
605 } 605 }
606 606
607 public static void TestValueArray() { 607 public static void TestValueArrayOfSByte()
608 {
609 using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.SByte)) {
610 Test.AssertEquals(0, array.Count());
611 Test.Assert(array.Append(0));
612 Test.AssertEquals(1, array.Count());
613 Test.Assert(array.Append(1));
614 Test.AssertEquals(2, array.Count());
615 Test.Assert(array.Append(5));
616 Test.AssertEquals(3, array.Count());
617 Test.Assert(array.Append(42));
618 Test.AssertEquals(4, array.Count());
619
620
621 Test.AssertEquals((sbyte)array[0], 0);
622 Test.AssertEquals((sbyte)array[1], 1);
623 Test.AssertEquals((sbyte)array[2], 5);
624 Test.AssertEquals((sbyte)array[3], 42);
625
626 array[0] = 120;
627 array[1] = -42;
628 Test.AssertEquals(4, array.Count());
629
630 Test.AssertEquals((sbyte)array[0], 120);
631 Test.AssertEquals((sbyte)array[1], -42);
632 Test.AssertEquals((sbyte)array[2], 5);
633 Test.AssertEquals((sbyte)array[3], 42);
634
635 Test.AssertEquals("[120, -42, 5, 42]", array.ToString());
636 }
637 }
638
639 public static void TestValueArrayOfByte()
640 {
641 using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.Byte)) {
642 Test.AssertEquals(0, array.Count());
643 Test.Assert(array.Append(0));
644 Test.AssertEquals(1, array.Count());
645 Test.Assert(array.Append(1));
646 Test.AssertEquals(2, array.Count());
647 Test.Assert(array.Append(5));
648 Test.AssertEquals(3, array.Count());
649 Test.Assert(array.Append(42));
650 Test.AssertEquals(4, array.Count());
651
652
653 Test.AssertEquals((byte)array[0], 0);
654 Test.AssertEquals((byte)array[1], 1);
655 Test.AssertEquals((byte)array[2], 5);
656 Test.AssertEquals((byte)array[3], 42);
657
658 array[0] = 155;
659 array[1] = 42;
660 Test.AssertEquals(4, array.Count());
661
662 Test.AssertEquals((byte)array[0], 155);
663 Test.AssertEquals((byte)array[1], 42);
664 Test.AssertEquals((byte)array[2], 5);
665 Test.AssertEquals((byte)array[3], 42);
666
667 Test.AssertEquals("[155, 42, 5, 42]", array.ToString());
668
669 Test.AssertRaises<OverflowException>(() => array[0] = 123214);
670 }
671 }
672
673 public static void TestValueArrayOfInts()
674 {
608 using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.Int32)) { 675 using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.Int32)) {
609 Test.AssertEquals(0, array.Count()); 676 Test.AssertEquals(0, array.Count());
610 Test.Assert(array.Append(0)); 677 Test.Assert(array.Append(0));
@@ -633,12 +700,52 @@ public static class TestEinaValue {
633 700
634 Test.AssertEquals("[1984, -42, 5, 42]", array.ToString()); 701 Test.AssertEquals("[1984, -42, 5, 42]", array.ToString());
635 } 702 }
703 }
704
705 public static void TestValueArrayOfInt64s()
706 {
707 using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.Int64)) {
708 Test.AssertEquals(0, array.Count());
709 Test.Assert(array.Append(0));
710 Test.AssertEquals(1, array.Count());
711 Test.Assert(array.Append(10000000000));
712 Test.AssertEquals(2, array.Count());
713 Test.Assert(array.Append(5));
714 Test.AssertEquals(3, array.Count());
715 Test.Assert(array.Append(42));
716 Test.AssertEquals(4, array.Count());
717
718
719 Test.AssertEquals((long)array[0], 0);
720 Test.AssertEquals((long)array[1], 10000000000);
721 Test.AssertEquals((long)array[2], 5);
722 Test.AssertEquals((long)array[3], 42);
723
724 array[0] = 1984;
725 array[1] = -42;
726 Test.AssertEquals(4, array.Count());
727
728 Test.AssertEquals((long)array[0], 1984);
729 Test.AssertEquals((long)array[1], -42);
730 Test.AssertEquals((long)array[2], 5);
731 Test.AssertEquals((long)array[3], 42);
732
733 Test.AssertEquals("[1984, -42, 5, 42]", array.ToString());
734 }
735 }
736
737 public static void TestValueArrayOfUInts()
738 {
636 739
637 using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.UInt32)) { 740 using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.UInt32)) {
638 Test.Assert(array.Append(2)); 741 Test.Assert(array.Append(2));
639 Test.AssertEquals((uint)array[0], (uint)2); 742 Test.AssertEquals((uint)array[0], (uint)2);
640 Test.AssertRaises<OverflowException>(() => array[0] = -1); 743 Test.AssertRaises<OverflowException>(() => array[0] = -1);
641 } 744 }
745 }
746
747 public static void TestValueArrayOfStrings()
748 {
642 749
643 using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.String)) { 750 using(Eina.Value array = new Eina.Value(Eina.ValueType.Array, Eina.ValueType.String)) {
644 751
diff --git a/src/tests/efl_mono/dummy_child.eo b/src/tests/efl_mono/dummy_child.eo
index b7845d9..f6de361 100644
--- a/src/tests/efl_mono/dummy_child.eo
+++ b/src/tests/efl_mono/dummy_child.eo
@@ -13,13 +13,41 @@ class Dummy.Child extends Dummy.Test_Object {
13 @property iface_was_set { 13 @property iface_was_set {
14 get {} 14 get {}
15 values { 15 values {
16 data: bool; 16 data: bool;
17 } 17 }
18 }
19
20 obligatory_beta_ctor @beta {
21 params {
22 @in a: int;
23 }
24 }
25
26 optional_beta_ctor @beta {
27 params {
28 @in a: int;
29 }
30 }
31
32 @property obligatory_beta_ctor_was_called {
33 get{}
34 values {
35 data: bool;
36 }
37 }
38
39 @property optional_beta_ctor_was_called {
40 get{}
41 values {
42 data: bool;
43 }
18 } 44 }
19 } 45 }
20 constructors { 46 constructors {
21 Dummy.Test_Iface.iface_prop @optional; 47 Dummy.Test_Iface.iface_prop @optional;
22 .double_params; 48 .double_params;
49 .obligatory_beta_ctor;
50 .optional_beta_ctor @optional;
23 } 51 }
24 implements { 52 implements {
25 Dummy.Test_Iface.iface_prop { get; set; } 53 Dummy.Test_Iface.iface_prop { get; set; }
diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo
index 99e8d02..517c783 100644
--- a/src/tests/efl_mono/dummy_test_object.eo
+++ b/src/tests/efl_mono/dummy_test_object.eo
@@ -2,6 +2,18 @@ import eina_types;
2 2
3type Dummy.MyInt: int; 3type Dummy.MyInt: int;
4 4
5const Dummy.Constvar_Bool : bool = true;
6const Dummy.Constvar_Int : int = -32766;
7const Dummy.Constvar_UInt : uint = 65533U;
8const Dummy.Constvar_Long : long = -2147483644L;
9const Dummy.Constvar_ULong : ulong = 4294967288UL;
10const Dummy.Constvar_LLong : llong = -9223372036854775800LL;
11const Dummy.Constvar_ULLong : ullong = 18446744073709551615ULL;
12const Dummy.Constvar_Float : float = 16777211.0f;
13const Dummy.Constvar_Double : double = 9007199254740988.0;
14const Dummy.Constvar_Char : char = '!';
15const Dummy.Constvar_String : string = "test_str";
16
5enum Dummy.SampleEnum { 17enum Dummy.SampleEnum {
6 v0, 18 v0,
7 v1, 19 v1,
@@ -64,9 +76,7 @@ struct @free(free) Dummy.StructSimple
64 76
65struct @free(free) Dummy.StructComplex { 77struct @free(free) Dummy.StructComplex {
66 farray: array<ptr(int)>; 78 farray: array<ptr(int)>;
67 finarray: inarray<int>;
68 flist: list<string>; 79 flist: list<string>;
69 finlist: inlist<ptr(int)>;
70 fhash: hash<string, string>; 80 fhash: hash<string, string>;
71 fiterator: iterator<ptr(int)>; 81 fiterator: iterator<ptr(int)>;
72 fany_value: any_value; 82 fany_value: any_value;
@@ -102,6 +112,10 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface
102 return: Dummy.Test_Object; 112 return: Dummy.Test_Object;
103 } 113 }
104 114
115 return_null_object {
116 return: Dummy.Test_Object;
117 }
118
105 int_out { 119 int_out {
106 params { 120 params {
107 @in x: int; 121 @in x: int;
@@ -508,153 +522,6 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface
508 return: array<Dummy.Numberwrapper>; 522 return: array<Dummy.Numberwrapper>;
509 } 523 }
510 524
511 /* Eina Inarray */
512
513 /* Integer */
514 eina_inarray_int_in {
515 params {
516 @in arr: inarray<ptr(int)>;
517 }
518 return: bool;
519 }
520
521 eina_inarray_int_in_own {
522 params {
523 @in arr: inarray<free(ptr(int),free) @owned> @owned;
524 }
525 return: bool;
526 }
527 check_eina_inarray_int_in_own {
528 return: bool;
529 }
530
531 eina_inarray_int_out {
532 params {
533 @out arr: inarray<ptr(int)>;
534 }
535 return: bool;
536 }
537 check_eina_inarray_int_out {
538 return: bool;
539 }
540
541 eina_inarray_int_out_own {
542 params {
543 @out arr: inarray<free(ptr(int),free) @owned> @owned;
544 }
545 return: bool;
546 }
547
548 eina_inarray_int_return {
549 return: inarray<int>;
550 }
551 check_eina_inarray_int_return {
552 return: bool;
553 }
554
555 eina_inarray_int_return_own {
556 return: inarray<free(ptr(int),free) @owned> @owned;
557 }
558
559 /* String */
560 eina_inarray_str_in {
561 params {
562 @in arr: inarray<string>;
563 }
564 return: bool;
565 }
566
567 eina_inarray_str_in_own {
568 params {
569 @in arr: inarray<mstring @owned> @owned;
570 }
571 return: bool;
572 }
573 check_eina_inarray_str_in_own {
574 return: bool;
575 }
576
577 eina_inarray_str_out {
578 params {
579 @out arr: inarray<string>;
580 }
581 return: bool;
582 }
583 check_eina_inarray_str_out {
584 return: bool;
585 }
586
587 eina_inarray_str_out_own {
588 params {
589 @out arr: inarray<mstring @owned> @owned;
590 }
591 return: bool;
592 }
593
594 eina_inarray_str_return {
595 return: inarray<string>;
596 }
597 check_eina_inarray_str_return {
598 return: bool;
599 }
600
601 eina_inarray_str_return_own {
602 return: inarray<mstring @owned> @owned;
603 }
604
605 /* Object */
606 eina_inarray_obj_in {
607 params {
608 @in arr: inarray<Dummy.Numberwrapper>;
609 }
610 return: bool;
611 }
612
613 eina_inarray_obj_in_own {
614 params {
615 @in arr: inarray<Dummy.Numberwrapper @owned> @owned;
616 }
617 return: bool;
618 }
619 check_eina_inarray_obj_in_own {
620 return: bool;
621 }
622
623 eina_inarray_obj_out {
624 params {
625 @out arr: inarray<Dummy.Numberwrapper>;
626 }
627 return: bool;
628 }
629 check_eina_inarray_obj_out {
630 return: bool;
631 }
632
633 eina_inarray_obj_out_own {
634 params {
635 @out arr: inarray<Dummy.Numberwrapper @owned> @owned;
636 }
637 return: bool;
638 }
639
640 eina_inarray_obj_return {
641 return: inarray<Dummy.Numberwrapper>;
642 }
643 check_eina_inarray_obj_return {
644 return: bool;
645 }
646
647 eina_inarray_obj_return_own {
648 return: inarray<Dummy.Numberwrapper @owned> @owned;
649 }
650
651 eina_inarray_obj_return_in {
652 params {
653 @in arr: inarray<Dummy.Numberwrapper>;
654 }
655 return: inarray<Dummy.Numberwrapper>;
656 }
657
658 /* Eina List */ 525 /* Eina List */
659 526
660 /* Integer */ 527 /* Integer */
@@ -802,154 +669,6 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface
802 return: list<Dummy.Numberwrapper>; 669 return: list<Dummy.Numberwrapper>;
803 } 670 }
804 671
805 /* Eina Inlist */
806
807 /* Integer */
808 eina_inlist_int_in {
809 params {
810 @in lst: inlist<int>;
811 }
812 return: bool;
813 }
814
815 eina_inlist_int_in_own {
816 params {
817 @in lst: inlist<free(ptr(int),free) @owned> @owned;
818 }
819 return: bool;
820 }
821 check_eina_inlist_int_in_own {
822 return: bool;
823 }
824
825 eina_inlist_int_out {
826 params {
827 @out lst: inlist<int>;
828 }
829 return: bool;
830 }
831 check_eina_inlist_int_out {
832 return: bool;
833 }
834
835 eina_inlist_int_out_own {
836 params {
837 @out lst: inlist<free(ptr(int),free) @owned> @owned;
838 }
839 return: bool;
840 }
841
842 eina_inlist_int_return {
843 return: inlist<int>;
844 }
845 check_eina_inlist_int_return {
846 return: bool;
847 }
848
849 eina_inlist_int_return_own {
850 return: inlist<free(ptr(int),free) @owned> @owned;
851 }
852
853 /* String */
854 eina_inlist_str_in {
855 params {
856 @in lst: inlist<string>;
857 }
858 return: bool;
859 }
860
861 eina_inlist_str_in_own {
862 params {
863 @in lst: inlist<mstring @owned> @owned;
864 }
865 return: bool;
866 }
867 check_eina_inlist_str_in_own {
868 return: bool;
869 }
870
871 eina_inlist_str_out {
872 params {
873 @out lst: inlist<string>;
874 }
875 return: bool;
876 }
877 check_eina_inlist_str_out {
878 return: bool;
879 }
880
881 eina_inlist_str_out_own {
882 params {
883 @out lst: inlist<mstring @owned> @owned;
884 }
885 return: bool;
886 }
887
888 eina_inlist_str_return {
889 return: inlist<string>;
890 }
891 check_eina_inlist_str_return {
892 return: bool;
893 }
894
895 eina_inlist_str_return_own {
896 return: inlist<mstring @owned> @owned;
897 }
898
899 /* Object */
900 eina_inlist_obj_in {
901 params {
902 @in lst: inlist<Dummy.Numberwrapper>;
903 }
904 return: bool;
905 }
906
907 eina_inlist_obj_in_own {
908 params {
909 @in lst: inlist<Dummy.Numberwrapper @owned> @owned;
910 }
911 return: bool;
912 }
913 check_eina_inlist_obj_in_own {
914 return: bool;
915 }
916
917 eina_inlist_obj_out {
918 params {
919 @out lst: inlist<Dummy.Numberwrapper>;
920 }
921 return: bool;
922 }
923 check_eina_inlist_obj_out {
924 return: bool;
925 }
926
927 eina_inlist_obj_out_own {
928 params {
929 @out lst: inlist<Dummy.Numberwrapper @owned> @owned;
930 }
931 return: bool;
932 }
933
934 eina_inlist_obj_return {
935 return: inlist<Dummy.Numberwrapper>;
936 }
937 check_eina_inlist_obj_return {
938 return: bool;
939 }
940
941 eina_inlist_obj_return_own {
942 return: inlist<Dummy.Numberwrapper @owned> @owned;
943 }
944
945 eina_inlist_obj_return_in {
946 params {
947 @in lst: inlist<Dummy.Numberwrapper>;
948 }
949 return: inlist<Dummy.Numberwrapper>;
950 }
951
952
953 // Eina Hash // 672 // Eina Hash //
954 673
955 // Integer // 674 // Integer //
@@ -1677,6 +1396,7 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface
1677 class.destructor; 1396 class.destructor;
1678 Efl.Object.constructor; 1397 Efl.Object.constructor;
1679 Efl.Part.part_get; 1398 Efl.Part.part_get;
1399 Efl.Object.provider_find;
1680 Dummy.Test_Iface.emit_test_conflicted; 1400 Dummy.Test_Iface.emit_test_conflicted;
1681 Dummy.Test_Iface.emit_nonconflicted; 1401 Dummy.Test_Iface.emit_nonconflicted;
1682 Dummy.Test_Iface.iface_prop { get; set; } 1402 Dummy.Test_Iface.iface_prop { get; set; }
diff --git a/src/tests/efl_mono/efl-mono-suite.runtimeconfig.json b/src/tests/efl_mono/efl-mono-suite.runtimeconfig.json
new file mode 100644
index 0000000..0773dae
--- /dev/null
+++ b/src/tests/efl_mono/efl-mono-suite.runtimeconfig.json
@@ -0,0 +1,10 @@
1{
2 "runtimeOptions": {
3 "tfm": "netcoreapp2.0",
4 "framework": {
5 "name": "Microsoft.NETCore.App",
6 "version": "2.0.0"
7 }
8 }
9}
10
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index 0cc3cbd..e4c7d72 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -73,6 +73,7 @@ typedef struct Dummy_Test_Object_Data
73 Eina_List *list_for_accessor; 73 Eina_List *list_for_accessor;
74 int setter_only; 74 int setter_only;
75 int iface_prop; 75 int iface_prop;
76 Eo *provider;
76} Dummy_Test_Object_Data; 77} Dummy_Test_Object_Data;
77 78
78typedef struct Dummy_Numberwrapper_Data 79typedef struct Dummy_Numberwrapper_Data
@@ -86,6 +87,8 @@ typedef struct Dummy_Child_Data
86 const char* a; 87 const char* a;
87 double b; 88 double b;
88 Eina_Bool iface_was_set; 89 Eina_Bool iface_was_set;
90 Eina_Bool obligatory_beta_ctor_was_called;
91 Eina_Bool optional_beta_ctor_was_called;
89} Dummy_Child_Data; 92} Dummy_Child_Data;
90 93
91typedef struct Dummy_Inherit_Helper_Data 94typedef struct Dummy_Inherit_Helper_Data
@@ -150,6 +153,9 @@ _dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd)
150 pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two")); 153 pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two"));
151 } 154 }
152 155
156 pd->provider = efl_add(DUMMY_NUMBERWRAPPER_CLASS, obj);
157 dummy_numberwrapper_number_set(pd->provider, 1999);
158
153 return obj; 159 return obj;
154} 160}
155 161
@@ -158,6 +164,11 @@ Efl_Object *_dummy_test_object_return_object(Eo *obj, EINA_UNUSED Dummy_Test_Obj
158 return obj; 164 return obj;
159} 165}
160 166
167Efl_Object *_dummy_test_object_return_null_object(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd)
168{
169 return NULL;
170}
171
161void _dummy_test_object_int_out(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, int x, int *y) 172void _dummy_test_object_int_out(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, int x, int *y)
162{ 173{
163 *y = -x; 174 *y = -x;
@@ -3332,19 +3343,10 @@ void struct_complex_with_values(Dummy_StructComplex *complex)
3332 eina_array_push(complex->farray, _new_int(0x2A)); 3343 eina_array_push(complex->farray, _new_int(0x2A));
3333 eina_array_push(complex->farray, _new_int(0x42)); 3344 eina_array_push(complex->farray, _new_int(0x42));
3334 3345
3335 complex->finarray = eina_inarray_new(sizeof(int), 0);
3336 eina_inarray_push(complex->finarray, _int_ref(0x0));
3337 eina_inarray_push(complex->finarray, _int_ref(0x2A));
3338 eina_inarray_push(complex->finarray, _int_ref(0x42));
3339
3340 complex->flist = eina_list_append(complex->flist, strdup("0x0")); 3346 complex->flist = eina_list_append(complex->flist, strdup("0x0"));
3341 complex->flist = eina_list_append(complex->flist, strdup("0x2A")); 3347 complex->flist = eina_list_append(complex->flist, strdup("0x2A"));
3342 complex->flist = eina_list_append(complex->flist, strdup("0x42")); 3348 complex->flist = eina_list_append(complex->flist, strdup("0x42"));
3343 3349
3344 complex->finlist = eina_inlist_append(complex->finlist, _new_inlist_int(0x0));
3345 complex->finlist = eina_inlist_append(complex->finlist, _new_inlist_int(0x2A));
3346 complex->finlist = eina_inlist_append(complex->finlist, _new_inlist_int(0x42));
3347
3348 complex->fhash = eina_hash_string_superfast_new(NULL); 3350 complex->fhash = eina_hash_string_superfast_new(NULL);
3349 eina_hash_add(complex->fhash, "aa", strdup("aaa")); 3351 eina_hash_add(complex->fhash, "aa", strdup("aaa"));
3350 eina_hash_add(complex->fhash, "bb", strdup("bbb")); 3352 eina_hash_add(complex->fhash, "bb", strdup("bbb"));
@@ -3374,15 +3376,9 @@ Eina_Bool check_and_modify_struct_complex(Dummy_StructComplex *complex)
3374 if (!_array_int_equal(complex->farray, base_seq_int, base_seq_int_size)) 3376 if (!_array_int_equal(complex->farray, base_seq_int, base_seq_int_size))
3375 return EINA_FALSE; 3377 return EINA_FALSE;
3376 3378
3377 if (!_inarray_int_equal(complex->finarray, base_seq_int, base_seq_int_size))
3378 return EINA_FALSE;
3379
3380 if (!_list_str_equal(complex->flist, base_seq_str, base_seq_str_size)) 3379 if (!_list_str_equal(complex->flist, base_seq_str, base_seq_str_size))
3381 return EINA_FALSE; 3380 return EINA_FALSE;
3382 3381
3383 if (!_inlist_int_equal(complex->finlist, base_seq_int, base_seq_int_size))
3384 return EINA_FALSE;
3385
3386 if (!_hash_str_check(complex->fhash, "aa", "aaa") 3382 if (!_hash_str_check(complex->fhash, "aa", "aaa")
3387 || !_hash_str_check(complex->fhash, "bb", "bbb") 3383 || !_hash_str_check(complex->fhash, "bb", "bbb")
3388 || !_hash_str_check(complex->fhash, "cc", "ccc")) 3384 || !_hash_str_check(complex->fhash, "cc", "ccc"))
@@ -3935,6 +3931,14 @@ int _dummy_test_object_dummy_test_iface_iface_prop_get(EINA_UNUSED const Eo *obj
3935 return pd->iface_prop; 3931 return pd->iface_prop;
3936} 3932}
3937 3933
3934Eo * _dummy_test_object_efl_object_provider_find(EINA_UNUSED const Eo *obj, Dummy_Test_Object_Data *pd, const Efl_Class *klass)
3935{
3936 EINA_LOG_ERR("klass: %p, NUMBERWRAPPER: %p", klass, DUMMY_NUMBERWRAPPER_CLASS);
3937 if (klass == DUMMY_NUMBERWRAPPER_CLASS)
3938 return pd->provider;
3939 return efl_provider_find(efl_super(obj, DUMMY_TEST_OBJECT_CLASS), klass);
3940}
3941
3938/// Dummy.Child 3942/// Dummy.Child
3939 3943
3940static Efl_Object * 3944static Efl_Object *
@@ -3944,6 +3948,8 @@ _dummy_child_efl_object_constructor(Eo *obj, Dummy_Child_Data *pd)
3944 3948
3945 pd->iface_prop = 1984; 3949 pd->iface_prop = 1984;
3946 pd->iface_was_set = EINA_FALSE; 3950 pd->iface_was_set = EINA_FALSE;
3951 pd->obligatory_beta_ctor_was_called = EINA_FALSE;
3952 pd->optional_beta_ctor_was_called = EINA_FALSE;
3947 return obj; 3953 return obj;
3948} 3954}
3949 3955
@@ -3972,6 +3978,27 @@ Eina_Bool _dummy_child_iface_was_set_get(EINA_UNUSED const Eo* obj, Dummy_Child_
3972{ 3978{
3973 return pd->iface_was_set; 3979 return pd->iface_was_set;
3974} 3980}
3981
3982void _dummy_child_obligatory_beta_ctor(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, EINA_UNUSED int a)
3983{
3984 pd->obligatory_beta_ctor_was_called = EINA_TRUE;
3985}
3986
3987void _dummy_child_optional_beta_ctor(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, EINA_UNUSED int a)
3988{
3989 pd->optional_beta_ctor_was_called = EINA_TRUE;
3990}
3991
3992Eina_Bool _dummy_child_obligatory_beta_ctor_was_called_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd)
3993{
3994 return pd->obligatory_beta_ctor_was_called;
3995}
3996
3997Eina_Bool _dummy_child_optional_beta_ctor_was_called_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd)
3998{
3999 return pd->optional_beta_ctor_was_called;
4000}
4001
3975EOLIAN static void 4002EOLIAN static void
3976_dummy_child_class_constructor(Efl_Class *klass) 4003_dummy_child_class_constructor(Efl_Class *klass)
3977{ 4004{
diff --git a/src/tests/efl_mono/meson.build b/src/tests/efl_mono/meson.build
index b01e274..52c6e31 100644
--- a/src/tests/efl_mono/meson.build
+++ b/src/tests/efl_mono/meson.build
@@ -25,7 +25,7 @@ foreach mono_gen_file : eo_files
25 eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'', 25 eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
26 input : mono_gen_file, 26 input : mono_gen_file,
27 output : [mono_gen_file + '.cs'], 27 output : [mono_gen_file + '.cs'],
28 command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories, 28 command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories,
29 '--dllimport', 'efl_mono_native_test', 29 '--dllimport', 'efl_mono_native_test',
30 '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'), 30 '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
31 '@INPUT@']) 31 '@INPUT@'])
@@ -34,6 +34,7 @@ endforeach
34efl_mono_test = library('efl_mono_test', 34efl_mono_test = library('efl_mono_test',
35 eo_file_targets, 35 eo_file_targets,
36 link_with : [efl_mono], 36 link_with : [efl_mono],
37 cs_args : extra_cs_args
37) 38)
38 39
39efl_mono_src = [ 40efl_mono_src = [
@@ -47,7 +48,6 @@ efl_mono_src = [
47 'Eo.cs', 48 'Eo.cs',
48 'EoPromises.cs', 49 'EoPromises.cs',
49 'Errors.cs', 50 'Errors.cs',
50 'Evas.cs',
51 'Events.cs', 51 'Events.cs',
52 'FunctionPointers.cs', 52 'FunctionPointers.cs',
53 'FunctionPointerMarshalling.cs', 53 'FunctionPointerMarshalling.cs',
@@ -64,11 +64,33 @@ efl_mono_src = [
64efl_mono_suite = executable('efl-mono-suite', 64efl_mono_suite = executable('efl-mono-suite',
65 efl_mono_src, 65 efl_mono_src,
66 link_with : [efl_mono, efl_mono_test], 66 link_with : [efl_mono, efl_mono_test],
67 cs_args : extra_cs_args
67) 68)
68 69
69env = environment() 70env = environment()
70env.set('MONO_PATH', efl_mono_test_suite_path ) 71env.set('MONO_PATH', efl_mono_test_suite_path )
71 72
73if (cs_is_dotnet)
74env.set('LD_LIBRARY_PATH', efl_mono_test_suite_path )
75copy_prog = find_program(['cp', 'copy'])
76
77configure_file(input : 'efl-mono-suite.runtimeconfig.json',
78 output : 'efl-mono-suite.runtimeconfig.json',
79 copy : true)
80
81custom_target('copy_efl_mono_dll',
82 build_by_default : true,
83 input : efl_mono,
84 output : efl_mono.full_path().split('/')[-1],
85 command : [copy_prog, '@INPUT@', '@OUTPUT@'])
86
87custom_target('copy_efl_mono_lib_dll',
88 build_by_default : true,
89 input : efl_mono_lib,
90 output : efl_mono_lib.full_path().split('/')[-1],
91 command : [copy_prog, '@INPUT@', '@OUTPUT@'])
92endif
93
72config_libs = ['eina', 'ecore', 'eo', 'efl', 'evas', 'eldbus', 'elementary'] 94config_libs = ['eina', 'ecore', 'eo', 'efl', 'evas', 'eldbus', 'elementary']
73load_lib = '' 95load_lib = ''
74 96
diff --git a/src/tests/eina/eina_test_convert.c b/src/tests/eina/eina_test_convert.c
index c8ccfcb..be8aea3 100644
--- a/src/tests/eina/eina_test_convert.c
+++ b/src/tests/eina/eina_test_convert.c
@@ -25,6 +25,7 @@
25#include <math.h> 25#include <math.h>
26#include <float.h> 26#include <float.h>
27#include <limits.h> 27#include <limits.h>
28#include <locale.h>
28 29
29#include <Eina.h> 30#include <Eina.h>
30 31
@@ -161,22 +162,96 @@ _eina_convert_fp_check(double d, Eina_F32p32 fp, int length)
161EFL_END_TEST 162EFL_END_TEST
162 163
163static void 164static void
164_eina_convert_strtod_c_check(const char *str, double expected_result) 165_eina_convert_strtod_c_check(const char *str)
165{ 166{
166 double result = eina_convert_strtod_c(str, NULL); 167 double d1;
168 double d2;
169 char *e1;
170 char *e2;
171
172 e1 = NULL;
173 d1 = eina_convert_strtod_c(str, &e1);
174
175 e2 = NULL;
176 d2 = strtod(str, &e2);
177
178 switch(fpclassify(d2))
179 {
180 case FP_NAN:
181 fail_if(fpclassify(d1) != FP_NAN);
182 break;
183 case FP_INFINITE:
184 fail_if(fpclassify(d1) != FP_INFINITE);
185 break;
186 default:
187 fail_if((fpclassify(d1) != FP_ZERO) &&
188 (fpclassify(d1) != FP_SUBNORMAL) &&
189 (fpclassify(d1) != FP_NORMAL));
190 if (!EINA_DBL_EQ(d1,d2) || (e1 != e2))
191 {
192 printf(" FP_NORMAL\n");
193 printf(" ERR: %s, %s\n", str, strerror(errno));
194 printf(" E1 **%.6f**, **%g**, %s\n", d1, d1, e1 ? e1 : "");
195 printf(" E2 **%.6f**, **%g**, %s\n", d2, d2, e2 ? e2 : "");
196 if (!EINA_DBL_EQ(d1,d2)) printf("different value\n");
197 if (e1 != e2) printf("different end position\n");
198 }
199
200 fail_if(!EINA_DBL_EQ(d1,d2) || (e1 != e2));
201 break;
202 }
167 203
168 fail_if(result != expected_result);
169} 204}
170 205
171EFL_START_TEST(eina_convert_strtod_c_simple) 206EFL_START_TEST(eina_convert_strtod_c_simple)
172{ 207{
173 _eina_convert_strtod_c_check("0.0", 0.0); 208 char *old;
174 _eina_convert_strtod_c_check("0.5", 0.5); 209
175 _eina_convert_strtod_c_check("1.0", 1.0); 210 old = setlocale(LC_ALL, "C");
176 _eina_convert_strtod_c_check("-0.5", -0.5); 211 _eina_convert_strtod_c_check("0");
177 _eina_convert_strtod_c_check("-1.0", -1.0); 212 _eina_convert_strtod_c_check("-0");
178 _eina_convert_strtod_c_check("3.45e-2", 0.0345); 213 _eina_convert_strtod_c_check(".1");
179 _eina_convert_strtod_c_check("3.45e+2", 345.0); 214 _eina_convert_strtod_c_check(" .");
215 _eina_convert_strtod_c_check(" 1.2e3");
216 _eina_convert_strtod_c_check(" +1.2e3");
217 _eina_convert_strtod_c_check("1.2e3");
218 _eina_convert_strtod_c_check("+1.2e3");
219 _eina_convert_strtod_c_check("+1.e3");
220 _eina_convert_strtod_c_check("-1.2e3");
221 _eina_convert_strtod_c_check("-1.2e3.5");
222 _eina_convert_strtod_c_check("-1.2e");
223 _eina_convert_strtod_c_check("--1.2e3.5");
224 _eina_convert_strtod_c_check("--1-.2e3.5");
225 _eina_convert_strtod_c_check("-a");
226 _eina_convert_strtod_c_check("a");
227 _eina_convert_strtod_c_check(".1e");
228 _eina_convert_strtod_c_check(".1e0");
229 _eina_convert_strtod_c_check(".1e3");
230 _eina_convert_strtod_c_check(".1e-3");
231 _eina_convert_strtod_c_check(".1e-");
232 _eina_convert_strtod_c_check(" .e-");
233 _eina_convert_strtod_c_check(" .e");
234 _eina_convert_strtod_c_check(" e");
235 _eina_convert_strtod_c_check(" e0");
236 _eina_convert_strtod_c_check(" ee");
237 _eina_convert_strtod_c_check(" -e");
238 _eina_convert_strtod_c_check(" .9");
239 _eina_convert_strtod_c_check(" ..9");
240 _eina_convert_strtod_c_check("009");
241 _eina_convert_strtod_c_check("0.09e02");
242 /* http://thread.gmane.org/gmane.editors.vim.devel/19268/ */
243 _eina_convert_strtod_c_check("0.9999999999999999999999999999999999");
244 _eina_convert_strtod_c_check("2.2250738585072010e-308"); // BUG
245 /* PHP (slashdot.jp): http://opensource.slashdot.jp/story/11/01/08/0527259/PHP%E3%81%AE%E6%B5%AE%E5%8B%95%E5%B0%8F%E6%95%B0%E7%82%B9%E5%87%A6%E7%90%86%E3%81%AB%E7%84%A1%E9%99%90%E3%83%AB%E3%83%BC%E3%83%97%E3%81%AE%E3%83%90%E3%82%B0 */
246 _eina_convert_strtod_c_check("2.2250738585072011e-308");
247 /* Gauche: http://blog.practical-scheme.net/gauche/20110203-bitten-by-floating-point-numbers-again */
248 _eina_convert_strtod_c_check("2.2250738585072012e-308");
249 _eina_convert_strtod_c_check("2.2250738585072013e-308");
250 _eina_convert_strtod_c_check("2.2250738585072014e-308");
251 _eina_convert_strtod_c_check(" NaNfoo");
252 _eina_convert_strtod_c_check(" -INFfoo");
253 _eina_convert_strtod_c_check(" InFiNiTyfoo");
254 setlocale(LC_ALL, old);
180} 255}
181EFL_END_TEST 256EFL_END_TEST
182 257
diff --git a/src/tests/elementary/efl_ui_suite.c b/src/tests/elementary/efl_ui_suite.c
index 16f7ad3..aa5de44 100644
--- a/src/tests/elementary/efl_ui_suite.c
+++ b/src/tests/elementary/efl_ui_suite.c
@@ -13,12 +13,14 @@ static const Efl_Test_Case etc[] = {
13 { "efl_ui_focus", efl_ui_test_focus}, 13 { "efl_ui_focus", efl_ui_test_focus},
14 { "efl_ui_focus_sub", efl_ui_test_focus_sub}, 14 { "efl_ui_focus_sub", efl_ui_test_focus_sub},
15 { "efl_ui_box", efl_ui_test_box}, 15 { "efl_ui_box", efl_ui_test_box},
16 { "efl_ui_table", efl_ui_test_table},
16 { "efl_ui_grid", efl_ui_test_grid}, 17 { "efl_ui_grid", efl_ui_test_grid},
17 { "efl_ui_relative_layout", efl_ui_test_relative_layout}, 18 { "efl_ui_relative_layout", efl_ui_test_relative_layout},
18 { "efl_ui_image", efl_ui_test_image}, 19 { "efl_ui_image", efl_ui_test_image},
19 { "efl_ui_image_zoomable", efl_ui_test_image_zoomable}, 20 { "efl_ui_image_zoomable", efl_ui_test_image_zoomable},
20 { "efl_ui_layout", efl_ui_test_layout}, 21 { "efl_ui_layout", efl_ui_test_layout},
21 { "Efl_Ui_Model", efl_ui_model }, 22 { "Efl_Ui_Model", efl_ui_model },
23 { "efl_ui_widget", efl_ui_test_widget },
22 { NULL, NULL } 24 { NULL, NULL }
23}; 25};
24 26
diff --git a/src/tests/elementary/efl_ui_suite.h b/src/tests/elementary/efl_ui_suite.h
index c337323..4f5e529 100644
--- a/src/tests/elementary/efl_ui_suite.h
+++ b/src/tests/elementary/efl_ui_suite.h
@@ -20,6 +20,7 @@
20 } 20 }
21 21
22void efl_ui_test_box(TCase *tc); 22void efl_ui_test_box(TCase *tc);
23void efl_ui_test_table(TCase *tc);
23void efl_ui_test_grid(TCase *tc); 24void efl_ui_test_grid(TCase *tc);
24void efl_ui_test_relative_layout(TCase *tc); 25void efl_ui_test_relative_layout(TCase *tc);
25void efl_ui_test_atspi(TCase *tc); 26void efl_ui_test_atspi(TCase *tc);
@@ -31,6 +32,7 @@ void efl_ui_test_focus(TCase *tc);
31void efl_ui_test_focus_sub(TCase *tc); 32void efl_ui_test_focus_sub(TCase *tc);
32 33
33void efl_ui_model(TCase *tc); 34void efl_ui_model(TCase *tc);
35void efl_ui_test_widget(TCase *tc);
34 36
35void loop_timer_interval_set(Eo *obj, double in); 37void loop_timer_interval_set(Eo *obj, double in);
36 38
diff --git a/src/tests/elementary/efl_ui_test_atspi.c b/src/tests/elementary/efl_ui_test_atspi.c
index ecb0f96..9aa0463 100644
--- a/src/tests/elementary/efl_ui_test_atspi.c
+++ b/src/tests/elementary/efl_ui_test_atspi.c
@@ -6,6 +6,7 @@
6#define EFL_ACCESS_OBJECT_BETA 6#define EFL_ACCESS_OBJECT_BETA
7#define EFL_ACCESS_OBJECT_PROTECTED 7#define EFL_ACCESS_OBJECT_PROTECTED
8 8
9#include <Efl_Ui.h>
9#include <Elementary.h> 10#include <Elementary.h>
10#include "elm_priv.h" 11#include "elm_priv.h"
11#include "efl_ui_suite.h" 12#include "efl_ui_suite.h"
@@ -286,8 +287,8 @@ EFL_START_TEST(test_efl_access_object_relationship_append)
286 Eina_Iterator *it; 287 Eina_Iterator *it;
287 unsigned int i = 0; 288 unsigned int i = 0;
288 289
289 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 290 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
290 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); 291 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win);
291 it = efl_access_object_relations_get(g_btn); 292 it = efl_access_object_relations_get(g_btn);
292 293
293 ck_assert(it != NULL); 294 ck_assert(it != NULL);
@@ -297,9 +298,9 @@ EFL_START_TEST(test_efl_access_object_relationship_append)
297 { 298 {
298 i++; 299 i++;
299 300
300 if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) 301 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO)
301 rel_to = rel; 302 rel_to = rel;
302 if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) 303 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM)
303 rel_from = rel; 304 rel_from = rel;
304 } 305 }
305 306
@@ -313,8 +314,8 @@ EFL_START_TEST(test_efl_access_object_relationship_append)
313 eina_iterator_free(it); 314 eina_iterator_free(it);
314 315
315 /* Check if append do not procude duplicated relations */ 316 /* Check if append do not procude duplicated relations */
316 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 317 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
317 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); 318 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win);
318 it = efl_access_object_relations_get(g_btn); i = 0; 319 it = efl_access_object_relations_get(g_btn); i = 0;
319 320
320 rel_to = rel_from = NULL; 321 rel_to = rel_from = NULL;
@@ -322,9 +323,9 @@ EFL_START_TEST(test_efl_access_object_relationship_append)
322 { 323 {
323 i++; 324 i++;
324 325
325 if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) 326 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO)
326 rel_to = rel; 327 rel_to = rel;
327 if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) 328 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM)
328 rel_from = rel; 329 rel_from = rel;
329 } 330 }
330 331
@@ -351,9 +352,9 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
351 unsigned int i = 0; 352 unsigned int i = 0;
352 353
353 /* Test if removal of single relationship works */ 354 /* Test if removal of single relationship works */
354 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 355 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
355 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); 356 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win);
356 efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 357 efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
357 it = efl_access_object_relations_get(g_btn); 358 it = efl_access_object_relations_get(g_btn);
358 359
359 ck_assert(it != NULL); 360 ck_assert(it != NULL);
@@ -363,9 +364,9 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
363 { 364 {
364 i++; 365 i++;
365 366
366 if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) 367 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO)
367 rel_to = rel; 368 rel_to = rel;
368 if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) 369 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM)
369 rel_from = rel; 370 rel_from = rel;
370 } 371 }
371 372
@@ -378,9 +379,9 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
378 eina_iterator_free(it); 379 eina_iterator_free(it);
379 380
380 /* Test if removal of type relationship works */ 381 /* Test if removal of type relationship works */
381 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 382 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
382 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win); 383 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_win);
383 efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, NULL); 384 efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, NULL);
384 it = efl_access_object_relations_get(g_btn); i = 0; 385 it = efl_access_object_relations_get(g_btn); i = 0;
385 386
386 rel_to = rel_from = NULL; 387 rel_to = rel_from = NULL;
@@ -388,9 +389,9 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
388 { 389 {
389 i++; 390 i++;
390 391
391 if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) 392 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO)
392 rel_to = rel; 393 rel_to = rel;
393 if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) 394 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM)
394 rel_from = rel; 395 rel_from = rel;
395 } 396 }
396 397
@@ -401,8 +402,8 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
401 eina_iterator_free(it); 402 eina_iterator_free(it);
402 403
403 /* Test if relationship is implicity removed when object is deleted */ 404 /* Test if relationship is implicity removed when object is deleted */
404 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 405 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
405 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg); 406 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_bg);
406 efl_del(g_bg); 407 efl_del(g_bg);
407 it = efl_access_object_relations_get(g_btn); i = 0; 408 it = efl_access_object_relations_get(g_btn); i = 0;
408 409
@@ -411,9 +412,9 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
411 { 412 {
412 i++; 413 i++;
413 414
414 if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) 415 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO)
415 rel_to = rel; 416 rel_to = rel;
416 if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) 417 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM)
417 rel_from = rel; 418 rel_from = rel;
418 } 419 }
419 420
@@ -431,20 +432,20 @@ EFL_START_TEST(test_efl_access_object_relationships_clear)
431 432
432 generate_app(); 433 generate_app();
433 434
434 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 435 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
435 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg); 436 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_bg);
436 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win); 437 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_win);
437 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); 438 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win);
438 439
439 efl_access_object_relationships_clear(g_btn); 440 efl_access_object_relationships_clear(g_btn);
440 441
441 it = efl_access_object_relations_get(g_btn); 442 it = efl_access_object_relations_get(g_btn);
442 EINA_ITERATOR_FOREACH(it, rel) 443 EINA_ITERATOR_FOREACH(it, rel)
443 { 444 {
444 ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_bg))); 445 ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) && eina_list_data_find(rel->objects, g_bg)));
445 ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_bg))); 446 ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) && eina_list_data_find(rel->objects, g_bg)));
446 ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_win))); 447 ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) && eina_list_data_find(rel->objects, g_win)));
447 ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_win))); 448 ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) && eina_list_data_find(rel->objects, g_win)));
448 } 449 }
449 eina_iterator_free(it); 450 eina_iterator_free(it);
450} 451}
diff --git a/src/tests/elementary/efl_ui_test_box.c b/src/tests/elementary/efl_ui_test_box.c
index af4eab0..b1792c9 100644
--- a/src/tests/elementary/efl_ui_test_box.c
+++ b/src/tests/elementary/efl_ui_test_box.c
@@ -2,6 +2,7 @@
2# include "elementary_config.h" 2# include "elementary_config.h"
3#endif 3#endif
4 4
5#include <Efl_Ui.h>
5#include <Elementary.h> 6#include <Elementary.h>
6#include "elm_suite.h" 7#include "elm_suite.h"
7 8
@@ -187,6 +188,7 @@ static void
187btn_hint_set(Eo *btn, Hint *hint) 188btn_hint_set(Eo *btn, Hint *hint)
188{ 189{
189 efl_gfx_entity_size_set(layout, hint->layout_size); 190 efl_gfx_entity_size_set(layout, hint->layout_size);
191 efl_gfx_hint_size_min_set(layout, hint->layout_size);
190 efl_gfx_hint_size_max_set(btn, hint->max); 192 efl_gfx_hint_size_max_set(btn, hint->max);
191 efl_gfx_hint_size_min_set(btn, hint->min); 193 efl_gfx_hint_size_min_set(btn, hint->min);
192 efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty); 194 efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty);
@@ -202,7 +204,7 @@ btn_geom_assert(Hint *hint, Eina_Rect btn_geom)
202 Eina_Size2D layout_size, layout_min; 204 Eina_Size2D layout_size, layout_min;
203 205
204 layout_size = efl_gfx_entity_size_get(layout); 206 layout_size = efl_gfx_entity_size_get(layout);
205 layout_min = efl_gfx_hint_size_min_get(layout); 207 layout_min = efl_gfx_hint_size_combined_min_get(layout);
206 layout_size.w = layout_size.w > layout_min.w ? layout_size.w : layout_min.w; 208 layout_size.w = layout_size.w > layout_min.w ? layout_size.w : layout_min.w;
207 layout_size.h = layout_size.h > layout_min.h ? layout_size.h : layout_min.h; 209 layout_size.h = layout_size.h > layout_min.h ? layout_size.h : layout_min.h;
208 210
@@ -343,10 +345,73 @@ EFL_START_TEST (efl_ui_box_layout_update_pack)
343} 345}
344EFL_END_TEST 346EFL_END_TEST
345 347
348EFL_START_TEST (efl_ui_box_size)
349{
350#define USERMIN_CHECK(a, b) \
351 efl_canvas_group_calculate(layout); \
352 user_min = efl_gfx_hint_size_min_get(layout); \
353 ck_assert_msg(COORD_EQ(user_min.w, (a)) && COORD_EQ(user_min.h, (b)), \
354 "Case box_size failed... user_min: (%d, %d) expected user_min: (%d, %d)", \
355 user_min.w, user_min.h, (a), (b));
356
357#define MIN_CHECK(a, b) \
358 efl_canvas_group_calculate(layout); \
359 min = efl_gfx_hint_size_combined_min_get(layout); \
360 ck_assert_msg(COORD_EQ(min.w, (a)) && COORD_EQ(min.h, (b)), \
361 "Case box_size failed... min: (%d, %d) expected min: (%d, %d)", \
362 min.w, min.h, (a), (b));
363
364 Eo *btn, *btn2, *btn3;
365 Eina_Size2D min, user_min;
366
367 btn = efl_add(EFL_UI_BUTTON_CLASS, layout,
368 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)),
369 efl_pack_end(layout, efl_added));
370
371 USERMIN_CHECK(0, 0);
372 MIN_CHECK(100, 100);
373
374 btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout,
375 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)),
376 efl_pack_end(layout, efl_added));
377 btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout,
378 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)),
379 efl_pack_end(layout, efl_added));
380 USERMIN_CHECK(0, 0);
381 MIN_CHECK(100, 300);
382
383 efl_pack_unpack(layout, btn2);
384 USERMIN_CHECK(0, 0);
385 MIN_CHECK(100, 200);
386
387 efl_pack_unpack(layout, btn3);
388 USERMIN_CHECK(0, 0);
389 MIN_CHECK(100, 100);
390
391 efl_pack_unpack(layout, btn);
392 USERMIN_CHECK(0, 0);
393 MIN_CHECK(0, 0);
394
395 efl_pack_end(layout, btn);
396 efl_gfx_hint_size_min_set(layout, EINA_SIZE2D(200, 200));
397 USERMIN_CHECK(200, 200);
398 MIN_CHECK(200, 200);
399
400 efl_pack_end(layout, btn2);
401 efl_pack_end(layout, btn3);
402 USERMIN_CHECK(200, 200);
403 MIN_CHECK(200, 300);
404
405#undef USERMIN_ASSERT
406#undef MIN_ASSERT
407}
408EFL_END_TEST
409
346void efl_ui_test_box(TCase *tc) 410void efl_ui_test_box(TCase *tc)
347{ 411{
348 tcase_add_checked_fixture(tc, layout_setup, layout_teardown); 412 tcase_add_checked_fixture(tc, layout_setup, layout_teardown);
349 tcase_add_test(tc, efl_ui_box_class_check); 413 tcase_add_test(tc, efl_ui_box_class_check);
350 tcase_add_test(tc, efl_ui_box_layout_update); 414 tcase_add_test(tc, efl_ui_box_layout_update);
351 tcase_add_test(tc, efl_ui_box_layout_update_pack); 415 tcase_add_test(tc, efl_ui_box_layout_update_pack);
416 tcase_add_test(tc, efl_ui_box_size);
352} 417}
diff --git a/src/tests/elementary/efl_ui_test_grid.c b/src/tests/elementary/efl_ui_test_grid.c
index 1ac7b96..1df8e4a 100644
--- a/src/tests/elementary/efl_ui_test_grid.c
+++ b/src/tests/elementary/efl_ui_test_grid.c
@@ -3,6 +3,7 @@
3#endif 3#endif
4 4
5#define EFL_ACCESS_OBJECT_BETA 5#define EFL_ACCESS_OBJECT_BETA
6#include <Efl_Ui.h>
6#include <Elementary.h> 7#include <Elementary.h>
7#include "efl_ui_suite.h" 8#include "efl_ui_suite.h"
8 9
diff --git a/src/tests/elementary/efl_ui_test_image.c b/src/tests/elementary/efl_ui_test_image.c
index 6c5e9f8..244f104 100644
--- a/src/tests/elementary/efl_ui_test_image.c
+++ b/src/tests/elementary/efl_ui_test_image.c
@@ -13,7 +13,7 @@ EFL_START_TEST(efl_ui_image_test_icon)
13 Eina_Bool ok; 13 Eina_Bool ok;
14 const char *icon_name; 14 const char *icon_name;
15 15
16 win = win_add(NULL, "image", EFL_UI_WIN_BASIC); 16 win = win_add(NULL, "image", EFL_UI_WIN_TYPE_BASIC);
17 17
18 image = efl_add(EFL_UI_IMAGE_CLASS, win); 18 image = efl_add(EFL_UI_IMAGE_CLASS, win);
19 efl_gfx_entity_visible_set(image, EINA_TRUE); 19 efl_gfx_entity_visible_set(image, EINA_TRUE);
diff --git a/src/tests/elementary/efl_ui_test_image_zoomable.c b/src/tests/elementary/efl_ui_test_image_zoomable.c
index cbb16ad..d9d9e10 100644
--- a/src/tests/elementary/efl_ui_test_image_zoomable.c
+++ b/src/tests/elementary/efl_ui_test_image_zoomable.c
@@ -13,7 +13,7 @@ EFL_START_TEST(efl_ui_test_image_zoomable_icon)
13 Eina_Bool ok; 13 Eina_Bool ok;
14 const char *icon_name; 14 const char *icon_name;
15 15
16 win = win_add(NULL, "photocam", EFL_UI_WIN_BASIC); 16 win = win_add(NULL, "photocam", EFL_UI_WIN_TYPE_BASIC);
17 17
18 img_zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win); 18 img_zoomable = efl_add(EFL_UI_IMAGE_ZOOMABLE_CLASS, win);
19 efl_gfx_entity_visible_set(img_zoomable, EINA_TRUE); 19 efl_gfx_entity_visible_set(img_zoomable, EINA_TRUE);
diff --git a/src/tests/elementary/efl_ui_test_layout.c b/src/tests/elementary/efl_ui_test_layout.c
index 660010b..8f52408 100644
--- a/src/tests/elementary/efl_ui_test_layout.c
+++ b/src/tests/elementary/efl_ui_test_layout.c
@@ -28,11 +28,11 @@ EFL_START_TEST(efl_ui_layout_test_property_bind)
28 const char *part_text; 28 const char *part_text;
29 const char text_value[] = "A random string for elm_layout_property_bind test"; 29 const char text_value[] = "A random string for elm_layout_property_bind test";
30 30
31 win = win_add(NULL, "layout", EFL_UI_WIN_BASIC); 31 win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
32 32
33 ly = efl_add(EFL_UI_LAYOUT_CLASS, win); 33 ly = efl_add(EFL_UI_LAYOUT_CLASS, win);
34 snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR); 34 snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR);
35 efl_file_set(ly, buf, "layout"); 35 efl_file_simple_load(ly, buf, "layout");
36 efl_gfx_entity_visible_set(ly, EINA_TRUE); 36 efl_gfx_entity_visible_set(ly, EINA_TRUE);
37 37
38 model = efl_add(EFL_GENERIC_MODEL_CLASS, win); 38 model = efl_add(EFL_GENERIC_MODEL_CLASS, win);
@@ -58,7 +58,7 @@ EFL_START_TEST(efl_ui_layout_test_layout_api_size_min)
58 Evas_Object *win; 58 Evas_Object *win;
59 Eina_Size2D res; 59 Eina_Size2D res;
60 60
61 win = win_add(NULL, "layout", EFL_UI_WIN_BASIC); 61 win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
62 /* this is just a test to not get segfaults in those calls */ 62 /* this is just a test to not get segfaults in those calls */
63 Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win); 63 Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win);
64 res = efl_layout_calc_size_min(layout, EINA_SIZE2D(2, 2)); 64 res = efl_layout_calc_size_min(layout, EINA_SIZE2D(2, 2));
@@ -71,7 +71,7 @@ EFL_START_TEST(efl_ui_layout_test_layout_api_update_hints)
71{ 71{
72 Evas_Object *win; 72 Evas_Object *win;
73 73
74 win = win_add(NULL, "layout", EFL_UI_WIN_BASIC); 74 win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
75 /* this is just a test to not get segfaults in those calls */ 75 /* this is just a test to not get segfaults in those calls */
76 Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win); 76 Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win);
77 efl_layout_calc_auto_update_hints_set(layout, EINA_TRUE); 77 efl_layout_calc_auto_update_hints_set(layout, EINA_TRUE);
@@ -83,17 +83,34 @@ EFL_START_TEST(efl_ui_layout_test_layout_force)
83{ 83{
84 Evas_Object *win; 84 Evas_Object *win;
85 85
86 win = win_add(NULL, "layout", EFL_UI_WIN_BASIC); 86 win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
87 /* this is just a test to not get segfaults in those calls */ 87 /* this is just a test to not get segfaults in those calls */
88 Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win); 88 Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win);
89 efl_layout_calc_force(layout); 89 efl_layout_calc_force(layout);
90} 90}
91EFL_END_TEST 91EFL_END_TEST
92 92
93EFL_START_TEST(efl_ui_layout_test_layout_theme)
94{
95 Evas_Object *win;
96 const char *klass, *group, *style;
97
98 win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
99 Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win,
100 efl_ui_layout_theme_set(efl_added, "win", "background", NULL)
101 );
102 efl_ui_layout_theme_get(layout, &klass, &group, &style);
103 ck_assert_str_eq(klass, "win");
104 ck_assert_str_eq(group, "background");
105 ck_assert(!style);
106}
107EFL_END_TEST
108
93void efl_ui_test_layout(TCase *tc) 109void efl_ui_test_layout(TCase *tc)
94{ 110{
95 tcase_add_test(tc, efl_ui_layout_test_property_bind); 111 tcase_add_test(tc, efl_ui_layout_test_property_bind);
96 tcase_add_test(tc, efl_ui_layout_test_layout_api_size_min); 112 tcase_add_test(tc, efl_ui_layout_test_layout_api_size_min);
97 tcase_add_test(tc, efl_ui_layout_test_layout_api_update_hints); 113 tcase_add_test(tc, efl_ui_layout_test_layout_api_update_hints);
98 tcase_add_test(tc, efl_ui_layout_test_layout_force); 114 tcase_add_test(tc, efl_ui_layout_test_layout_force);
115 tcase_add_test(tc, efl_ui_layout_test_layout_theme);
99} 116}
diff --git a/src/tests/elementary/efl_ui_test_relative_layout.c b/src/tests/elementary/efl_ui_test_relative_layout.c
index 0471154..f769bf4 100644
--- a/src/tests/elementary/efl_ui_test_relative_layout.c
+++ b/src/tests/elementary/efl_ui_test_relative_layout.c
@@ -2,6 +2,7 @@
2# include "elementary_config.h" 2# include "elementary_config.h"
3#endif 3#endif
4 4
5#include <Efl_Ui.h>
5#include <Elementary.h> 6#include <Elementary.h>
6#include "elm_suite.h" 7#include "elm_suite.h"
7 8
@@ -209,7 +210,7 @@ static void
209layout_setup() 210layout_setup()
210{ 211{
211 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), 212 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
212 efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC)); 213 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC));
213 214
214 layout = efl_add(EFL_UI_RELATIVE_LAYOUT_CLASS, win, 215 layout = efl_add(EFL_UI_RELATIVE_LAYOUT_CLASS, win,
215 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(200, 200))); 216 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(200, 200)));
diff --git a/src/tests/elementary/efl_ui_test_table.c b/src/tests/elementary/efl_ui_test_table.c
new file mode 100644
index 0000000..ac96db5
--- /dev/null
+++ b/src/tests/elementary/efl_ui_test_table.c
@@ -0,0 +1,429 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Efl_Ui.h>
6#include <Elementary.h>
7#include "elm_suite.h"
8
9#define COORD_EQ(a, b) (!!(abs(a - b) < 2))
10#define GEOMETRY_EQ(a, b) (COORD_EQ(a.x, b.x) && COORD_EQ(a.y, b.y) && \
11 COORD_EQ(a.w, b.w) && COORD_EQ(a.h, b.h))
12
13typedef struct {
14 Eina_Size2D max;
15 Eina_Size2D min;
16 double weightx;
17 double weighty;
18 double alignx;
19 double aligny;
20 int marginl;
21 int marginr;
22 int margint;
23 int marginb;
24 Efl_Gfx_Hint_Aspect mode;
25 Eina_Size2D aspect;
26 Eina_Bool fillx;
27 Eina_Bool filly;
28 Eina_Size2D layout_size;
29 Eina_Size2D layout_expected;
30 Eina_Rect expected;
31 char testname[1024];
32} Hint;
33
34static Hint hints[] = {
35 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(0, 0), 1, 1, 0.5, 0.5, 0, 0, 0, 0,
36 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
37 EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200),
38 EINA_RECT(0, 0, 200, 200), "[0]" },
39 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.5, 0, 0, 0, 0,
40 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
41 EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200),
42 EINA_RECT(0, 0, 200, 200), "[1]" },
43 { EINA_SIZE2D(50, 150), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0,
44 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
45 EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200),
46 EINA_RECT((200 - 70) * 0.3, (200 - 150) * 0.7, 70, 150), "[2]" },
47 { EINA_SIZE2D(150, -1), EINA_SIZE2D(70, 70), 0, 0, 0.3, 0.7, 0, 0, 0, 0,
48 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE,
49 EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200),
50 EINA_RECT((200 - 70) * 0.8, (200 - 70) * 0.2, 70, 70), "[3]" },
51 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0,
52 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE,
53 EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200),
54 EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.2, 70, 70), "[4]" },
55 { EINA_SIZE2D(150, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0,
56 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE,
57 EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 200),
58 EINA_RECT((200 - 70) * 0.3, (200 - 70) * 0.2, 70, 70), "[5]" },
59 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0,
60 EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE,
61 EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210),
62 EINA_RECT((200 - 70) * 0.8, 0, 70, 70 * 3), "[6]" },
63 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0,
64 EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE,
65 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
66 EINA_RECT((300 - 70) * 0.8, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[7]" },
67 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0,
68 EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE,
69 EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210),
70 EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[8]" },
71 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0,
72 EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE,
73 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
74 EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.2, 70, 70 * 3), "[9]" },
75 { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0,
76 EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE,
77 EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210),
78 EINA_RECT((200 - 70) * 0.8, 0, 70, 70 * 3), "[10]" },
79 { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 0, 1, 0.3, 0.7, 0, 0, 0, 0,
80 EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE,
81 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
82 EINA_RECT((300 - 70) * 0.8, (300 - 70 * 3) * 0.7, 70, 70 * 3), "[11]" },
83 { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0,
84 EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE,
85 EINA_SIZE2D(200, 200), EINA_SIZE2D(200, 210),
86 EINA_RECT((200 - 70) * 0.3, 0, 70, 70 * 3), "[12]" },
87 { EINA_SIZE2D(-1, 150), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0,
88 EFL_GFX_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_FALSE,
89 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
90 EINA_RECT((300 - 70) * 0.3, (300 - 70 * 3) * 0.2, 70, 70 * 3), "[13]" },
91};
92
93static Hint hints2[][2] = {
94 {
95 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0,
96 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE,
97 EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300),
98 EINA_RECT((150 - 70) * 0.3, (150 - 70) * 0.7, 70, 70), "[1/1 weight btn]" },
99 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0,
100 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE,
101 EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300),
102 EINA_RECT((150 - 70) * 0.8, (150 - 70) * 0.2 + 150, 70, 70), "[1/1 weight btn2]" }
103 },
104 {
105 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0,
106 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE,
107 EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300),
108 EINA_RECT((150 - 70) * 0.3, 0, 70, 70), "[0/1 weight btn]" },
109 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0,
110 EFL_GFX_HINT_ASPECT_VERTICAL, EINA_SIZE2D(1, 3), EINA_TRUE, EINA_TRUE,
111 EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300),
112 EINA_RECT((150 - ((300 - 70) / 3)) * 0.8, 70, (300 - 70) / 3, (300 - 70)), "[0/1 weight btn2]" }
113 },
114 {
115 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.3, 0.7, 0, 0, 0, 0,
116 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE,
117 EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300),
118 EINA_RECT((150 - 70) * 0.3, (300 - 210) * 0.2, 70, 70), "[0/0 weight btn]" },
119 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 0, 0.8, 0.2, 0, 0, 0, 0,
120 EFL_GFX_HINT_ASPECT_HORIZONTAL, EINA_SIZE2D(1, 2), EINA_TRUE, EINA_FALSE,
121 EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300),
122 EINA_RECT((150 - 70) * 0.8, (300 - 210) * 0.2 + 70, 70, 70 * 2), "[0/0 weight btn2]" }
123 },
124};
125
126static Hint hints3[][3] = {
127 {
128 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0,
129 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
130 EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300),
131 EINA_RECT(0, 0, 150, 100), "[1/1/1 weight_l btn]" },
132 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0,
133 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
134 EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300),
135 EINA_RECT(0, 100, 150, 100), "[1/1/1 weight_l btn2]" },
136 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0,
137 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
138 EINA_SIZE2D(150, 300), EINA_SIZE2D(150, 300),
139 EINA_RECT(0, 100 + 100, 150, 100), "[1/1/1 weight_l btn3]" }
140 },
141 {
142 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0,
143 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
144 EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270),
145 EINA_RECT(0, 0, 150, 85), "[1/1/1 weight_m btn]" },
146 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0,
147 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
148 EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270),
149 EINA_RECT(0, 85, 150, 100), "[1/1/1 weight_m btn2]" },
150 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0,
151 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
152 EINA_SIZE2D(150, 270), EINA_SIZE2D(150, 270),
153 EINA_RECT(0, 100 + 85, 150, 85), "[1/1/1 weight_m btn3]" }
154 },
155 {
156 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.3, 0.7, 0, 0, 0, 0,
157 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
158 EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 240),
159 EINA_RECT(0, 0, 150, 70), "[1/1/1 weight_s btn]" },
160 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 100), 1, 1, 0.8, 0.2, 0, 0, 0, 0,
161 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
162 EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 240),
163 EINA_RECT(0, 70, 150, 100), "[1/1/1 weight_s btn2]" },
164 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(70, 70), 1, 1, 0.8, 0.2, 0, 0, 0, 0,
165 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
166 EINA_SIZE2D(150, 200), EINA_SIZE2D(150, 240),
167 EINA_RECT(0, 170, 150, 70), "[1/1/1 weight_s btn3]" }
168 },
169};
170
171static Hint hints_matrix[] = {
172 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 0, 0, 0.2, 0.8, 0, 0, 0, 0,
173 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_TRUE,
174 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
175 EINA_RECT(10 + (90 - 50) * 0.2, 20, 50, (300 - 50) / 3), "pack btn1" },
176 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 0, 0, 0.5, 0.5, 20, 20, 0, 0,
177 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
178 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
179 EINA_RECT(10 + (90 - 50) * 0.5, 103 + 5, 50, (300 - 50) / 3), "pack btn2" },
180 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 0, 1, -99, 100, 0, 0, 0, 0,
181 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_FALSE, EINA_FALSE,
182 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
183 EINA_RECT(10, 191 + 5 + (83 - 50) * 1, 50, 50), "pack btn3" },
184 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 0, 0, 0.5, 0.5, 0, 0, 0, 0,
185 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
186 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
187 EINA_RECT(110, 20, 170 * 2 / 3, (300 - 50) / 3), "pack btn4" },
188 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 70), 2, 2, 0.5, 0.5, 0, 0, 0, 0,
189 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
190 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
191 EINA_RECT(110, 103 + 5, 170 * 2 / 3, (300 - 50) / 3), "pack btn5" },
192 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 1, 1, 0.5, 0.5, 0, 0, 0, 0,
193 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
194 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
195 EINA_RECT(110, 191 + 5, 170 * 2 / 3, (300 - 50) / 3), "pack btn6" },
196 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 1, 0, 0.5, 0.5, 0, 0, 0, 0,
197 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
198 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
199 EINA_RECT(120 + 170 * 2 / 3, 20, 170 / 3, (300 - 50) / 3), "pack btn7" },
200 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 1, 1, 0.5, 0.5, 0, 0, 0, 0,
201 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
202 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
203 EINA_RECT(120 + 170 * 2 / 3, 103 + 5, 170 / 3, (300 - 50) * 2 / 3 + 5), "pack btn8" },
204 { EINA_SIZE2D(-1, -1), EINA_SIZE2D(50, 50), 1, 1, 0.5, 0.5, 0, 0, 0, 0,
205 EFL_GFX_HINT_ASPECT_NONE, EINA_SIZE2D(0, 0), EINA_TRUE, EINA_TRUE,
206 EINA_SIZE2D(300, 300), EINA_SIZE2D(300, 300),
207 EINA_RECT(120 + 170 * 2 / 3, 191 + 5, 170 / 3, (300 - 50) / 3), "pack btn9" },
208};
209
210static Eo *win, *layout;
211
212static void
213btn_hint_set(Eo *btn, Hint *hint)
214{
215 efl_gfx_entity_size_set(layout, hint->layout_size);
216 efl_gfx_hint_size_min_set(layout, hint->layout_size);
217 efl_gfx_hint_size_max_set(btn, hint->max);
218 efl_gfx_hint_size_min_set(btn, hint->min);
219 efl_gfx_hint_margin_set(btn, hint->marginl, hint->marginr,
220 hint->margint, hint->marginb);
221 efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty);
222 efl_gfx_hint_align_set(btn, hint->alignx, hint->aligny);
223 efl_gfx_hint_fill_set(btn, hint->fillx, hint->filly);
224 efl_gfx_hint_aspect_set(btn, hint->mode, hint->aspect);
225 efl_canvas_group_calculate(layout);
226}
227
228static void
229btn_geom_assert(Hint *hint, Eina_Rect btn_geom)
230{
231 Eina_Size2D layout_size, layout_min;
232
233 layout_size = efl_gfx_entity_size_get(layout);
234 layout_min = efl_gfx_hint_size_combined_min_get(layout);
235 layout_size.w = layout_size.w > layout_min.w ? layout_size.w : layout_min.w;
236 layout_size.h = layout_size.h > layout_min.h ? layout_size.h : layout_min.h;
237
238 ck_assert_msg(GEOMETRY_EQ(btn_geom, hint->expected),
239 "Case %s failed... button geometry: (%d, %d, %d, %d) expected geometry: (%d, %d, %d, %d)",
240 hint->testname, btn_geom.x, btn_geom.y, btn_geom.w, btn_geom.h,
241 hint->expected.x, hint->expected.y, hint->expected.w, hint->expected.h);
242 ck_assert_msg(COORD_EQ(layout_size.w, hint->layout_expected.w) &&
243 COORD_EQ(layout_size.h, hint->layout_expected.h),
244 "Case %s failed... layout size: (%d, %d) expected size: (%d, %d)",
245 hint->testname, layout_size.w, layout_size.h,
246 hint->layout_expected.w, hint->layout_expected.h);
247}
248
249static void
250layout_setup()
251{
252 win = win_add();
253
254 layout = efl_add(EFL_UI_TABLE_CLASS, win,
255 efl_pack_align_set(efl_added, 0.8, 0.2),
256 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
257}
258
259static void
260layout_teardown()
261{
262 if (win)
263 {
264 efl_del(win);
265 win = NULL;
266 }
267}
268
269EFL_START_TEST (efl_ui_table_class_check)
270{
271 const char *class;
272
273 class = efl_class_name_get(layout);
274
275 ck_assert(class != NULL);
276 ck_assert(!strcmp(class, "Efl.Ui.Table"));
277}
278EFL_END_TEST
279
280EFL_START_TEST (efl_ui_table_layout_update)
281{
282 int i, max_index = (sizeof(hints) / sizeof(Hint));
283
284 Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout,
285 efl_pack_table(layout, efl_added, 0, 0, 1, 1));
286
287 for (i = 0; i < max_index; i++)
288 {
289 btn_hint_set(btn, &hints[i]);
290 btn_geom_assert(&hints[i], efl_gfx_entity_geometry_get(btn));
291 }
292}
293EFL_END_TEST
294
295EFL_START_TEST (efl_ui_table_layout_update_pack)
296{
297 int i, max_index2, max_index3;
298 Eo *btn, *btn2, *btn3;
299
300 max_index2 = ((sizeof(hints2) / sizeof(Hint)) / 2);
301 max_index3 = ((sizeof(hints3) / sizeof(Hint)) / 3);
302
303 btn = efl_add(EFL_UI_BUTTON_CLASS, layout,
304 efl_pack_table(layout, efl_added, 0, 0, 1, 1));
305 btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout,
306 efl_pack_table(layout, efl_added, 0, 1, 1, 1));
307
308 for (i = 0; i < max_index2; i++)
309 {
310 btn_hint_set(btn, &hints2[i][0]);
311 btn_hint_set(btn2, &hints2[i][1]);
312 btn_geom_assert(&hints2[i][0], efl_gfx_entity_geometry_get(btn));
313 btn_geom_assert(&hints2[i][1], efl_gfx_entity_geometry_get(btn2));
314 }
315
316 btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout,
317 efl_pack_table(layout, efl_added, 0, 2, 1, 1));
318
319 for (i = 0; i < max_index3; i++)
320 {
321 btn_hint_set(btn, &hints3[i][0]);
322 btn_hint_set(btn2, &hints3[i][1]);
323 btn_hint_set(btn3, &hints3[i][2]);
324 btn_geom_assert(&hints3[i][0], efl_gfx_entity_geometry_get(btn));
325 btn_geom_assert(&hints3[i][1], efl_gfx_entity_geometry_get(btn2));
326 btn_geom_assert(&hints3[i][2], efl_gfx_entity_geometry_get(btn3));
327 }
328}
329EFL_END_TEST
330
331EFL_START_TEST (efl_ui_table_layout_update_matrix)
332{
333 int i, j, max_index = (sizeof(hints_matrix) / sizeof(Hint));
334 Eo *btn[9];
335
336 efl_gfx_hint_margin_set(layout, 10, 10, 20, 20);
337 efl_ui_table_homogeneous_set(layout, 0, 1);
338 efl_pack_padding_set(layout, 10, 5, 0);
339
340 for (i = 0; i < 3; i++)
341 {
342 for (j = 0; j < 3; j++)
343 {
344 btn[3 * i + j] = efl_add(EFL_UI_BUTTON_CLASS, layout,
345 efl_pack_table(layout, efl_added, i, j, 1, 1));
346
347 if ((i == 2) && (j == 1))
348 efl_pack_table(layout, btn[3 * i + j], i, j, 1, 2);
349 }
350 }
351 for (i = 0; i < max_index; i++)
352 btn_hint_set(btn[i], &hints_matrix[i]);
353
354 for (i = 0; i < max_index; i++)
355 btn_geom_assert(&hints_matrix[i], efl_gfx_entity_geometry_get(btn[i]));
356}
357EFL_END_TEST
358
359EFL_START_TEST (efl_ui_table_size)
360{
361#define USERMIN_CHECK(a, b) \
362 efl_canvas_group_calculate(layout); \
363 user_min = efl_gfx_hint_size_min_get(layout); \
364 ck_assert_msg(COORD_EQ(user_min.w, (a)) && COORD_EQ(user_min.h, (b)), \
365 "Case table_size failed... user_min: (%d, %d) expected user_min: (%d, %d)", \
366 user_min.w, user_min.h, (a), (b));
367
368#define MIN_CHECK(a, b) \
369 efl_canvas_group_calculate(layout); \
370 min = efl_gfx_hint_size_combined_min_get(layout); \
371 ck_assert_msg(COORD_EQ(min.w, (a)) && COORD_EQ(min.h, (b)), \
372 "Case table_size failed... min: (%d, %d) expected min: (%d, %d)", \
373 min.w, min.h, (a), (b));
374
375 Eo *btn, *btn2, *btn3;
376 Eina_Size2D min, user_min;
377
378 btn = efl_add(EFL_UI_BUTTON_CLASS, layout,
379 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)),
380 efl_pack_table(layout, efl_added, 0, 0, 1, 1));
381
382 USERMIN_CHECK(0, 0);
383 MIN_CHECK(100, 100);
384
385 btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout,
386 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)),
387 efl_pack_table(layout, efl_added, 0, 1, 1, 1));
388 btn3 = efl_add(EFL_UI_BUTTON_CLASS, layout,
389 efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)),
390 efl_pack_table(layout, efl_added, 0, 2, 1, 1));
391 USERMIN_CHECK(0, 0);
392 MIN_CHECK(100, 300);
393
394 efl_pack_unpack(layout, btn);
395 USERMIN_CHECK(0, 0);
396 MIN_CHECK(100, 200);
397
398 efl_pack_unpack(layout, btn2);
399 USERMIN_CHECK(0, 0);
400 MIN_CHECK(100, 100);
401
402 efl_pack_unpack(layout, btn3);
403 USERMIN_CHECK(0, 0);
404 MIN_CHECK(0, 0);
405
406 efl_pack_table(layout, btn, 0, 0, 1, 1);
407 efl_gfx_hint_size_min_set(layout, EINA_SIZE2D(200, 200));
408 USERMIN_CHECK(200, 200);
409 MIN_CHECK(200, 200);
410
411 efl_pack_table(layout, btn2, 0, 1, 1, 1);
412 efl_pack_table(layout, btn3, 0, 2, 1, 1);
413 USERMIN_CHECK(200, 200);
414 MIN_CHECK(200, 300);
415
416#undef USERMIN_ASSERT
417#undef MIN_ASSERT
418}
419EFL_END_TEST
420
421void efl_ui_test_table(TCase *tc)
422{
423 tcase_add_checked_fixture(tc, layout_setup, layout_teardown);
424 tcase_add_test(tc, efl_ui_table_class_check);
425 tcase_add_test(tc, efl_ui_table_size);
426 tcase_add_test(tc, efl_ui_table_layout_update);
427 tcase_add_test(tc, efl_ui_table_layout_update_pack);
428 tcase_add_test(tc, efl_ui_table_layout_update_matrix);
429}
diff --git a/src/tests/elementary/efl_ui_test_widget.c b/src/tests/elementary/efl_ui_test_widget.c
new file mode 100644
index 0000000..ad1a60f
--- /dev/null
+++ b/src/tests/elementary/efl_ui_test_widget.c
@@ -0,0 +1,182 @@
1//#define EFL_NOLEGACY_API_SUPPORT
2#ifdef HAVE_CONFIG_H
3# include "elementary_config.h"
4#endif
5#include <Elementary.h>
6#include "elm_widget.h"
7#include <Efl_Ui.h>
8#include "efl_ui_suite.h"
9
10typedef struct {
11 Efl_Ui_Widget *btn1, *btn2;
12 Efl_Ui_Widget *box;
13 Efl_Ui_Widget *win;
14 Efl_Ui_Widget *ic;
15} State;
16
17static void
18_small_ui(State *s)
19{
20 s->win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
21 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
22 efl_text_set(efl_added, "Hello World"));
23
24 s->ic = efl_add(EFL_UI_IMAGE_CLASS, s->win,
25 efl_ui_win_icon_object_set(s->win, efl_added));
26
27 s->box = efl_add(EFL_UI_BOX_CLASS, s->win,
28 efl_content_set(s->win, efl_added));
29
30 s->btn1 = efl_add(EFL_UI_BUTTON_CLASS, s->box,
31 efl_text_set(efl_added, "Quit1"),
32 efl_pack(s->box, efl_added));
33
34 s->btn2 = efl_add(EFL_UI_BUTTON_CLASS, s->box,
35 efl_text_set(efl_added, "Quit"),
36 efl_pack(s->box, efl_added));
37
38}
39
40EFL_START_TEST(efl_ui_test_widget_parent_iterator)
41{
42 Eina_Iterator *it;
43 Efl_Ui_Widget *o;
44 Eina_Array *a;
45 State s;
46
47 a = eina_array_new(10);
48 _small_ui(&s);
49 eina_array_push(a, s.win);
50 eina_array_push(a, s.box);
51 eina_array_push(a, s.btn1);
52
53 it = efl_ui_widget_parent_iterator(s.btn1);
54 EINA_ITERATOR_FOREACH(it, o)
55 {
56 ck_assert_ptr_eq(eina_array_pop(a), o);
57 }
58 eina_iterator_free(it);
59 ck_assert_int_eq(eina_array_count(a), 0);
60}
61EFL_END_TEST
62
63EFL_START_TEST(efl_ui_test_widget_widget_iterator)
64{
65 Eina_Iterator *it;
66 Efl_Ui_Widget *o;
67 Eina_Array *a;
68 State s;
69
70 a = eina_array_new(10);
71 _small_ui(&s);
72 eina_array_push(a, s.btn2);
73 eina_array_push(a, s.btn1);
74 eina_array_push(a, s.box);
75 eina_array_push(a, s.ic); //Hack arround the icon of the window
76 eina_array_push(a, s.win);
77
78 it = efl_ui_widget_tree_widget_iterator(s.win);
79 EINA_ITERATOR_FOREACH(it, o)
80 {
81 Eo *c = eina_array_pop(a);
82 ck_assert_ptr_eq(c, o);
83 }
84 eina_iterator_free(it);
85 ck_assert_int_eq(eina_array_count(a), 0);
86}
87EFL_END_TEST
88
89static Evas_Object*
90resize_object(Efl_Canvas_Object *o)
91{
92 Efl_Ui_Widget_Data *pd = efl_data_scope_safe_get(o, EFL_UI_WIDGET_CLASS);
93
94 return eina_list_data_get(pd->subobjs);
95}
96
97EFL_START_TEST(efl_ui_test_widget_widget_sub_iterator)
98{
99 Eina_Iterator *it;
100 Efl_Ui_Widget *o;
101 Eina_Array *a;
102 State s;
103
104 a = eina_array_new(10);
105 _small_ui(&s);
106 eina_array_push(a, s.btn2);
107 eina_array_push(a, s.btn1);
108 eina_array_push(a, s.box);
109
110 it = efl_ui_widget_tree_widget_iterator(s.box);
111 EINA_ITERATOR_FOREACH(it, o)
112 {
113 ck_assert_ptr_eq(eina_array_pop(a), o);
114 }
115 eina_iterator_free(it);
116 ck_assert_int_eq(eina_array_count(a), 0);
117}
118EFL_END_TEST
119
120EFL_START_TEST(efl_ui_test_widget_iterator)
121{
122 Eina_Iterator *it;
123 Efl_Ui_Widget *o;
124 Eina_Array *a;
125 State s;
126
127 a = eina_array_new(10);
128 _small_ui(&s);
129 eina_array_push(a, resize_object(s.btn2));
130 eina_array_push(a, s.btn2);
131 eina_array_push(a, resize_object(s.btn1));
132 eina_array_push(a, s.btn1);
133 eina_array_push(a, resize_object(s.box));
134 eina_array_push(a, s.box);
135 eina_array_push(a, resize_object(s.ic));
136 eina_array_push(a, s.ic);
137 eina_array_push(a, s.win);
138
139 it = efl_ui_widget_tree_iterator(s.win);
140 EINA_ITERATOR_FOREACH(it, o)
141 {
142 ck_assert_ptr_eq(eina_array_pop(a), o);
143 }
144 eina_iterator_free(it);
145 ck_assert_int_eq(eina_array_count(a), 0);
146}
147EFL_END_TEST
148
149EFL_START_TEST(efl_ui_test_widget_sub_iterator)
150{
151 Eina_Iterator *it;
152 Efl_Ui_Widget *o;
153 Eina_Array *a;
154 State s;
155
156 a = eina_array_new(10);
157 _small_ui(&s);
158 eina_array_push(a, resize_object(s.btn2));
159 eina_array_push(a, s.btn2);
160 eina_array_push(a, resize_object(s.btn1));
161 eina_array_push(a, s.btn1);
162 eina_array_push(a, resize_object(s.box));
163 eina_array_push(a, s.box);
164
165 it = efl_ui_widget_tree_iterator(s.box);
166 EINA_ITERATOR_FOREACH(it, o)
167 {
168 ck_assert_ptr_eq(eina_array_pop(a), o);
169 }
170 eina_iterator_free(it);
171 ck_assert_int_eq(eina_array_count(a), 0);
172}
173EFL_END_TEST
174
175void efl_ui_test_widget(TCase *tc)
176{
177 tcase_add_test(tc, efl_ui_test_widget_parent_iterator);
178 tcase_add_test(tc, efl_ui_test_widget_widget_iterator);
179 tcase_add_test(tc, efl_ui_test_widget_widget_sub_iterator);
180 tcase_add_test(tc, efl_ui_test_widget_iterator);
181 tcase_add_test(tc, efl_ui_test_widget_sub_iterator);
182}
diff --git a/src/tests/elementary/elm_code_test_syntax.c b/src/tests/elementary/elm_code_test_syntax.c
index 9703227..8aa3dcb 100644
--- a/src/tests/elementary/elm_code_test_syntax.c
+++ b/src/tests/elementary/elm_code_test_syntax.c
@@ -64,7 +64,7 @@ EFL_START_TEST(elm_code_syntax_c)
64 64
65 win = win_add(NULL, "syntax", ELM_WIN_BASIC); 65 win = win_add(NULL, "syntax", ELM_WIN_BASIC);
66 widget = elm_code_widget_add(win, code); 66 widget = elm_code_widget_add(win, code);
67 elm_obj_code_widget_code_get(widget)->file->mime = "text/x-csrc"; 67 efl_ui_code_widget_code_get(widget)->file->mime = "text/x-csrc";
68 elm_code_widget_syntax_enabled_set(widget, EINA_TRUE); 68 elm_code_widget_syntax_enabled_set(widget, EINA_TRUE);
69 69
70 _append_line(file, "#include <stdio.h>"); 70 _append_line(file, "#include <stdio.h>");
diff --git a/src/tests/elementary/elm_test_atspi.c b/src/tests/elementary/elm_test_atspi.c
index 649af0b..ebd121b 100644
--- a/src/tests/elementary/elm_test_atspi.c
+++ b/src/tests/elementary/elm_test_atspi.c
@@ -285,8 +285,8 @@ EFL_START_TEST(test_efl_access_object_relationship_append)
285 Eina_Iterator *it; 285 Eina_Iterator *it;
286 unsigned int i = 0; 286 unsigned int i = 0;
287 287
288 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 288 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
289 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); 289 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win);
290 it = efl_access_object_relations_get(g_btn); 290 it = efl_access_object_relations_get(g_btn);
291 291
292 ck_assert(it != NULL); 292 ck_assert(it != NULL);
@@ -296,9 +296,9 @@ EFL_START_TEST(test_efl_access_object_relationship_append)
296 { 296 {
297 i++; 297 i++;
298 298
299 if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) 299 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO)
300 rel_to = rel; 300 rel_to = rel;
301 if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) 301 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM)
302 rel_from = rel; 302 rel_from = rel;
303 } 303 }
304 304
@@ -312,8 +312,8 @@ EFL_START_TEST(test_efl_access_object_relationship_append)
312 eina_iterator_free(it); 312 eina_iterator_free(it);
313 313
314 /* Check if append do not procude duplicated relations */ 314 /* Check if append do not procude duplicated relations */
315 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 315 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
316 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); 316 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win);
317 it = efl_access_object_relations_get(g_btn); i = 0; 317 it = efl_access_object_relations_get(g_btn); i = 0;
318 318
319 rel_to = rel_from = NULL; 319 rel_to = rel_from = NULL;
@@ -321,9 +321,9 @@ EFL_START_TEST(test_efl_access_object_relationship_append)
321 { 321 {
322 i++; 322 i++;
323 323
324 if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) 324 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO)
325 rel_to = rel; 325 rel_to = rel;
326 if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) 326 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM)
327 rel_from = rel; 327 rel_from = rel;
328 } 328 }
329 329
@@ -350,9 +350,9 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
350 unsigned int i = 0; 350 unsigned int i = 0;
351 351
352 /* Test if removal of single relationship works */ 352 /* Test if removal of single relationship works */
353 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 353 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
354 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); 354 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win);
355 efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 355 efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
356 it = efl_access_object_relations_get(g_btn); 356 it = efl_access_object_relations_get(g_btn);
357 357
358 ck_assert(it != NULL); 358 ck_assert(it != NULL);
@@ -362,9 +362,9 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
362 { 362 {
363 i++; 363 i++;
364 364
365 if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) 365 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO)
366 rel_to = rel; 366 rel_to = rel;
367 if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) 367 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM)
368 rel_from = rel; 368 rel_from = rel;
369 } 369 }
370 370
@@ -377,9 +377,9 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
377 eina_iterator_free(it); 377 eina_iterator_free(it);
378 378
379 /* Test if removal of type relationship works */ 379 /* Test if removal of type relationship works */
380 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 380 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
381 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win); 381 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_win);
382 efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, NULL); 382 efl_access_object_relationship_remove(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, NULL);
383 it = efl_access_object_relations_get(g_btn); i = 0; 383 it = efl_access_object_relations_get(g_btn); i = 0;
384 384
385 rel_to = rel_from = NULL; 385 rel_to = rel_from = NULL;
@@ -387,9 +387,9 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
387 { 387 {
388 i++; 388 i++;
389 389
390 if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) 390 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO)
391 rel_to = rel; 391 rel_to = rel;
392 if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) 392 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM)
393 rel_from = rel; 393 rel_from = rel;
394 } 394 }
395 395
@@ -400,8 +400,8 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
400 eina_iterator_free(it); 400 eina_iterator_free(it);
401 401
402 /* Test if relationship is implicity removed when object is deleted */ 402 /* Test if relationship is implicity removed when object is deleted */
403 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 403 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
404 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg); 404 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_bg);
405 efl_del(g_bg); 405 efl_del(g_bg);
406 it = efl_access_object_relations_get(g_btn); i = 0; 406 it = efl_access_object_relations_get(g_btn); i = 0;
407 407
@@ -410,9 +410,9 @@ EFL_START_TEST(test_efl_access_object_relationship_remove)
410 { 410 {
411 i++; 411 i++;
412 412
413 if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) 413 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO)
414 rel_to = rel; 414 rel_to = rel;
415 if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) 415 if (rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM)
416 rel_from = rel; 416 rel_from = rel;
417 } 417 }
418 418
@@ -430,20 +430,20 @@ EFL_START_TEST(test_efl_access_object_relationships_clear)
430 430
431 generate_app(); 431 generate_app();
432 432
433 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); 433 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_bg);
434 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg); 434 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_bg);
435 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win); 435 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_TO, g_win);
436 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); 436 efl_access_object_relationship_append(g_btn, EFL_ACCESS_RELATION_TYPE_FLOWS_FROM, g_win);
437 437
438 efl_access_object_relationships_clear(g_btn); 438 efl_access_object_relationships_clear(g_btn);
439 439
440 it = efl_access_object_relations_get(g_btn); 440 it = efl_access_object_relations_get(g_btn);
441 EINA_ITERATOR_FOREACH(it, rel) 441 EINA_ITERATOR_FOREACH(it, rel)
442 { 442 {
443 ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_bg))); 443 ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) && eina_list_data_find(rel->objects, g_bg)));
444 ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_bg))); 444 ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) && eina_list_data_find(rel->objects, g_bg)));
445 ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_win))); 445 ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_TO) && eina_list_data_find(rel->objects, g_win)));
446 ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_win))); 446 ck_assert(!((rel->type == EFL_ACCESS_RELATION_TYPE_FLOWS_FROM) && eina_list_data_find(rel->objects, g_win)));
447 } 447 }
448 eina_iterator_free(it); 448 eina_iterator_free(it);
449} 449}
diff --git a/src/tests/elementary/elm_test_box.c b/src/tests/elementary/elm_test_box.c
index e5a8683..8ec5111 100644
--- a/src/tests/elementary/elm_test_box.c
+++ b/src/tests/elementary/elm_test_box.c
@@ -41,8 +41,42 @@ EFL_START_TEST(elm_atspi_role_get)
41} 41}
42EFL_END_TEST 42EFL_END_TEST
43 43
44EFL_START_TEST(elm_box_disabled_test)
45{
46 Evas_Object *win, *box, *o;
47 int i;
48
49 win = win_add(NULL, "box", ELM_WIN_BASIC);
50
51 box = elm_box_add(win);
52 elm_win_resize_object_add(win, box);
53
54 for (i = 0; i < 3; ++i)
55 {
56 o = elm_button_add(box);
57 elm_box_pack_end(box, o);
58 }
59
60 elm_object_disabled_set(box, EINA_TRUE);
61 elm_object_disabled_set(box, EINA_TRUE);
62 ck_assert_int_eq(elm_object_disabled_get(box), EINA_TRUE);
63 ck_assert_int_eq(elm_object_disabled_get(o), EINA_TRUE);
64 elm_object_disabled_set(box, EINA_FALSE);
65 ck_assert_int_eq(elm_object_disabled_get(box), EINA_FALSE);
66 ck_assert_int_eq(elm_object_disabled_get(o), EINA_FALSE);
67 elm_object_disabled_set(box, EINA_TRUE);
68 elm_object_disabled_set(o, EINA_TRUE);
69 ck_assert_int_eq(elm_object_disabled_get(box), EINA_TRUE);
70 ck_assert_int_eq(elm_object_disabled_get(o), EINA_TRUE);
71 elm_object_disabled_set(box, EINA_FALSE);
72 ck_assert_int_eq(elm_object_disabled_get(box), EINA_FALSE);
73 ck_assert_int_eq(elm_object_disabled_get(o), EINA_TRUE);
74}
75EFL_END_TEST
76
44void elm_test_box(TCase *tc) 77void elm_test_box(TCase *tc)
45{ 78{
46 tcase_add_test(tc, elm_box_legacy_type_check); 79 tcase_add_test(tc, elm_box_legacy_type_check);
47 tcase_add_test(tc, elm_atspi_role_get); 80 tcase_add_test(tc, elm_atspi_role_get);
81 tcase_add_test(tc, elm_box_disabled_test);
48} 82}
diff --git a/src/tests/elementary/elm_test_config.c b/src/tests/elementary/elm_test_config.c
index 19ecbc5..636120f 100644
--- a/src/tests/elementary/elm_test_config.c
+++ b/src/tests/elementary/elm_test_config.c
@@ -3,6 +3,7 @@
3#endif 3#endif
4 4
5#define EFL_ACCESS_OBJECT_PROTECTED 5#define EFL_ACCESS_OBJECT_PROTECTED
6#include <Efl_Ui.h>
6#include <Elementary.h> 7#include <Elementary.h>
7#include "elm_suite.h" 8#include "elm_suite.h"
8 9
diff --git a/src/tests/elementary/elm_test_gengrid.c b/src/tests/elementary/elm_test_gengrid.c
index 87efc61..77a4eb4 100644
--- a/src/tests/elementary/elm_test_gengrid.c
+++ b/src/tests/elementary/elm_test_gengrid.c
@@ -153,11 +153,62 @@ EFL_START_TEST(elm_gengrid_focus)
153} 153}
154EFL_END_TEST 154EFL_END_TEST
155 155
156static void
157_gengrid_item_content_test_realize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
158{
159 ecore_main_loop_quit();
160}
161
162static Evas_Object *
163_item_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_UNUSED)
164{
165 Evas_Object *ic = elm_button_add(obj);
166 return ic;
167}
168
169EFL_START_TEST(elm_gengrid_item_content)
170{
171 Evas_Object *win, *gengrid;
172 Elm_Genlist_Item_Class *gtc;
173 Evas_Object *content, *parent;
174 Elm_Object_Item *it;
175
176 gtc = elm_gengrid_item_class_new();
177 gtc->item_style = "default";
178 gtc->func.content_get = _item_content_get;
179 gtc->func.state_get = NULL;
180 gtc->func.del = NULL;
181
182 win = win_add(NULL, "gengrid", ELM_WIN_BASIC);
183
184 gengrid = elm_gengrid_add(win);
185 evas_object_smart_callback_add(gengrid, "realized", _gengrid_item_content_test_realize, NULL);
186
187 it = elm_gengrid_item_append(gengrid, gtc, NULL, NULL, NULL);
188
189 evas_object_resize(gengrid, 100, 100);
190 evas_object_resize(win, 150, 150);
191 evas_object_show(gengrid);
192 evas_object_show(win);
193
194 ecore_main_loop_begin();
195
196 content = elm_object_item_part_content_get(it, "elm.swallow.end");
197 parent = elm_object_parent_widget_get(content);
198 ck_assert_ptr_eq(parent, gengrid);
199
200 elm_gengrid_item_all_contents_unset(it, NULL);
201 parent = elm_object_parent_widget_get(content);
202 ck_assert_ptr_eq(parent, win);
203}
204EFL_END_TEST
205
156void elm_test_gengrid(TCase *tc) 206void elm_test_gengrid(TCase *tc)
157{ 207{
158 tcase_add_test(tc, elm_gengrid_legacy_type_check); 208 tcase_add_test(tc, elm_gengrid_legacy_type_check);
159 tcase_add_test(tc, elm_atspi_role_get); 209 tcase_add_test(tc, elm_atspi_role_get);
160 tcase_add_test(tc, elm_gengrid_focus); 210 tcase_add_test(tc, elm_gengrid_focus);
211 tcase_add_test(tc, elm_gengrid_item_content);
161#if 0 212#if 0
162 tcase_add_test(tc, elm_atspi_children_parent); 213 tcase_add_test(tc, elm_atspi_children_parent);
163#endif 214#endif
diff --git a/src/tests/elementary/elm_test_genlist.c b/src/tests/elementary/elm_test_genlist.c
index d0f89aa..894a6fb 100644
--- a/src/tests/elementary/elm_test_genlist.c
+++ b/src/tests/elementary/elm_test_genlist.c
@@ -119,6 +119,56 @@ EFL_START_TEST(elm_genlist_test_item_iteration)
119} 119}
120EFL_END_TEST 120EFL_END_TEST
121 121
122static void
123_genlist_item_content_test_realize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
124{
125 ecore_main_loop_quit();
126}
127
128static Evas_Object *
129_item_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_UNUSED)
130{
131 Evas_Object *ic = elm_button_add(obj);
132 return ic;
133}
134
135EFL_START_TEST(elm_genlist_test_item_content)
136{
137 Elm_Genlist_Item_Class *gtc;
138 Evas_Object *content, *parent;
139 Elm_Object_Item *it;
140
141 gtc = elm_genlist_item_class_new();
142 gtc->item_style = "default";
143 gtc->func.content_get = _item_content_get;
144 gtc->func.state_get = NULL;
145 gtc->func.del = NULL;
146
147 win = win_add(NULL, "genlist", ELM_WIN_BASIC);
148
149 genlist = elm_genlist_add(win);
150 evas_object_smart_callback_add(genlist, "realized", _genlist_item_content_test_realize, NULL);
151
152 it = elm_genlist_item_append(genlist, gtc, NULL, NULL,
153 ELM_GENLIST_ITEM_NONE, NULL, NULL);
154
155 evas_object_resize(genlist, 100, 100);
156 evas_object_resize(win, 150, 150);
157 evas_object_show(genlist);
158 evas_object_show(win);
159
160 ecore_main_loop_begin();
161
162 content = elm_object_item_part_content_get(it, "elm.swallow.end");
163 parent = elm_object_parent_widget_get(content);
164 ck_assert_ptr_eq(parent, genlist);
165
166 elm_genlist_item_all_contents_unset(it, NULL);
167 parent = elm_object_parent_widget_get(content);
168 ck_assert_ptr_eq(parent, win);
169}
170EFL_END_TEST
171
122EFL_START_TEST(elm_genlist_test_legacy_type_check) 172EFL_START_TEST(elm_genlist_test_legacy_type_check)
123{ 173{
124 const char *type; 174 const char *type;
@@ -520,6 +570,7 @@ void elm_test_genlist(TCase *tc)
520 tcase_add_test(tc, elm_genlist_test_legacy_type_check); 570 tcase_add_test(tc, elm_genlist_test_legacy_type_check);
521 tcase_add_test(tc, elm_genlist_test_item_destroy); 571 tcase_add_test(tc, elm_genlist_test_item_destroy);
522 tcase_add_test(tc, elm_genlist_test_item_iteration); 572 tcase_add_test(tc, elm_genlist_test_item_iteration);
573 tcase_add_test(tc, elm_genlist_test_item_content);
523 tcase_add_test(tc, elm_genlist_test_atspi_role_get); 574 tcase_add_test(tc, elm_genlist_test_atspi_role_get);
524 tcase_add_test(tc, elm_genlist_test_atspi_children_get1); 575 tcase_add_test(tc, elm_genlist_test_atspi_children_get1);
525 tcase_add_test(tc, elm_genlist_test_atspi_children_get2); 576 tcase_add_test(tc, elm_genlist_test_atspi_children_get2);
diff --git a/src/tests/elementary/elm_test_image.c b/src/tests/elementary/elm_test_image.c
index 7e95591..6d6ff52 100644
--- a/src/tests/elementary/elm_test_image.c
+++ b/src/tests/elementary/elm_test_image.c
@@ -3,6 +3,7 @@
3#endif 3#endif
4 4
5#define EFL_ACCESS_OBJECT_BETA 5#define EFL_ACCESS_OBJECT_BETA
6#include <Efl_Ui.h>
6#include <Elementary.h> 7#include <Elementary.h>
7#include "elm_suite.h" 8#include "elm_suite.h"
8 9
diff --git a/src/tests/elementary/elm_test_layout.c b/src/tests/elementary/elm_test_layout.c
index 5184086..b5ee17a 100644
--- a/src/tests/elementary/elm_test_layout.c
+++ b/src/tests/elementary/elm_test_layout.c
@@ -70,9 +70,22 @@ EFL_START_TEST(elm_layout_test_swallows)
70} 70}
71EFL_END_TEST 71EFL_END_TEST
72 72
73EFL_START_TEST(elm_layout_test_text_set)
74{
75 Evas_Object *win, *layout;
76
77 win = win_add(NULL, "layout", ELM_WIN_BASIC);
78
79 layout = elm_layout_add(win);
80 ck_assert(!elm_layout_text_set(layout, "blahblah", "test"));
81}
82EFL_END_TEST
83
84
73void elm_test_layout(TCase *tc) 85void elm_test_layout(TCase *tc)
74{ 86{
75 tcase_add_test(tc, elm_layout_test_legacy_type_check); 87 tcase_add_test(tc, elm_layout_test_legacy_type_check);
76 tcase_add_test(tc, elm_atspi_role_get); 88 tcase_add_test(tc, elm_atspi_role_get);
77 tcase_add_test(tc, elm_layout_test_swallows); 89 tcase_add_test(tc, elm_layout_test_swallows);
90 tcase_add_test(tc, elm_layout_test_text_set);
78} 91}
diff --git a/src/tests/elementary/elm_test_spinner.c b/src/tests/elementary/elm_test_spinner.c
index 4765d32..99c3696 100644
--- a/src/tests/elementary/elm_test_spinner.c
+++ b/src/tests/elementary/elm_test_spinner.c
@@ -3,6 +3,7 @@
3#endif 3#endif
4 4
5#define EFL_ACCESS_OBJECT_BETA 5#define EFL_ACCESS_OBJECT_BETA
6#include <Efl_Ui.h>
6#include <Elementary.h> 7#include <Elementary.h>
7#include "elm_suite.h" 8#include "elm_suite.h"
8 9
diff --git a/src/tests/elementary/meson.build b/src/tests/elementary/meson.build
index f9e6a0e..eaffab6 100644
--- a/src/tests/elementary/meson.build
+++ b/src/tests/elementary/meson.build
@@ -123,6 +123,7 @@ efl_ui_suite_src = [
123 'efl_ui_test_focus.c', 123 'efl_ui_test_focus.c',
124 'efl_ui_test_focus_sub.c', 124 'efl_ui_test_focus_sub.c',
125 'efl_ui_test_box.c', 125 'efl_ui_test_box.c',
126 'efl_ui_test_table.c',
126 'efl_ui_test_grid.c', 127 'efl_ui_test_grid.c',
127 'efl_ui_test_relative_layout.c', 128 'efl_ui_test_relative_layout.c',
128 'efl_ui_test_image.c', 129 'efl_ui_test_image.c',
@@ -130,6 +131,7 @@ efl_ui_suite_src = [
130 'efl_ui_test_layout.c', 131 'efl_ui_test_layout.c',
131 'efl_ui_suite.h', 132 'efl_ui_suite.h',
132 'efl_ui_model.c', 133 'efl_ui_model.c',
134 'efl_ui_test_widget.c',
133] 135]
134 136
135efl_ui_suite = executable('efl_ui_suite', 137efl_ui_suite = executable('efl_ui_suite',
diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c
index fe2976e..682a307 100644
--- a/src/tests/elementary/suite_helpers.c
+++ b/src/tests/elementary/suite_helpers.c
@@ -159,16 +159,15 @@ _win_hide(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *e
159} 159}
160 160
161static void 161static void
162_ui_win_show(void *data EINA_UNUSED, const Efl_Event *ev) 162_ui_win_visibility_change(void *data EINA_UNUSED, const Efl_Event *ev)
163{ 163{
164 _win_show(NULL, NULL, ev->object, NULL); 164 if (ev->info)
165} 165 _win_show(NULL, NULL, ev->object, NULL);
166 166 else
167static void 167 {
168_ui_win_hide(void *data EINA_UNUSED, const Efl_Event *ev) 168 _win_hide(NULL, NULL, ev->object, NULL);
169{ 169 efl_key_data_set(ev->object, "timer", NULL);
170 _win_hide(NULL, NULL, ev->object, NULL); 170 }
171 efl_key_data_set(ev->object, "timer", NULL);
172} 171}
173 172
174EFL_CLASS_SIMPLE_CLASS(efl_loop, "Efl.Loop", EFL_LOOP_CLASS) 173EFL_CLASS_SIMPLE_CLASS(efl_loop, "Efl.Loop", EFL_LOOP_CLASS)
@@ -182,7 +181,7 @@ _elm_suite_win_create()
182 if (legacy_mode) 181 if (legacy_mode)
183 win = elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC); 182 win = elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC);
184 else 183 else
185 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC)); 184 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC));
186 if (!buffer) return win; 185 if (!buffer) return win;
187 loop = efl_add(efl_loop_realized_class_get(), win); 186 loop = efl_add(efl_loop_realized_class_get(), win);
188 timer = efl_add(EFL_LOOP_TIMER_CLASS, loop, 187 timer = efl_add(EFL_LOOP_TIMER_CLASS, loop,
@@ -201,8 +200,7 @@ _elm_suite_win_create()
201 } 200 }
202 else 201 else
203 { 202 {
204 efl_event_callback_add(win, EFL_GFX_ENTITY_EVENT_SHOW, _ui_win_show, NULL); 203 efl_event_callback_add(win, EFL_GFX_ENTITY_EVENT_VISIBILITY_CHANGED, _ui_win_visibility_change, NULL);
205 efl_event_callback_add(win, EFL_GFX_ENTITY_EVENT_HIDE, _ui_win_hide, NULL);
206 } 204 }
207 return win; 205 return win;
208} 206}
diff --git a/src/tests/elua/elua_lib.c b/src/tests/elua/elua_lib.c
index bcf1b26..c39d056 100644
--- a/src/tests/elua/elua_lib.c
+++ b/src/tests/elua/elua_lib.c
@@ -29,11 +29,6 @@ EFL_START_TEST(elua_api)
29 st = elua_state_new("test"); 29 st = elua_state_new("test");
30 fail_if(!st); 30 fail_if(!st);
31 31
32 /* elua APIs here try accessing files by relative path,
33 * prevent any unintentional file accesses in cwd
34 */
35 fail_if(chdir(TESTS_SRC_DIR));
36
37 /* test env vars */ 32 /* test env vars */
38 setenv("ELUA_CORE_DIR", "foo", 1); 33 setenv("ELUA_CORE_DIR", "foo", 1);
39 setenv("ELUA_MODULES_DIR", "bar", 1); 34 setenv("ELUA_MODULES_DIR", "bar", 1);
@@ -85,22 +80,6 @@ EFL_START_TEST(elua_api)
85 fail_if(lua_type(lst, -1) != LUA_TFUNCTION); 80 fail_if(lua_type(lst, -1) != LUA_TFUNCTION);
86 lua_pop(lst, 1); 81 lua_pop(lst, 1);
87 82
88 fail_if(!elua_util_require(st, "util"));
89 fail_if(!elua_util_string_run(st, "return 1337", "foo"));
90 fail_if(elua_util_string_run(st, "foo bar", "foo")); /* invalid code */
91 fail_if(elua_util_app_load(st, "test"));
92 fail_if(lua_type(lst, -1) != LUA_TFUNCTION);
93 lua_pop(lst, 1);
94 fail_if(!elua_util_app_load(st, "non_existent_app"));
95 fail_if(lua_type(lst, -1) != LUA_TSTRING);
96 lua_pop(lst, 1);
97 fail_if(elua_io_loadfile(st, ELUA_CORE_DIR "/util.lua"));
98 fail_if(lua_type(lst, -1) != LUA_TFUNCTION);
99 lua_pop(lst, 1);
100 fail_if(!elua_io_loadfile(st, ELUA_CORE_DIR "/non_existent_file.lua"));
101 fail_if(lua_type(lst, -1) != LUA_TSTRING);
102 lua_pop(lst, 1);
103
104 fd = mkstemp(buf); 83 fd = mkstemp(buf);
105 fail_if(fd < 0); 84 fail_if(fd < 0);
106 f = fdopen(fd, "wb"); 85 f = fdopen(fd, "wb");
@@ -118,6 +97,11 @@ EFL_START_TEST(elua_api)
118 fail_if(!elua_util_error_report(st, 5)); 97 fail_if(!elua_util_error_report(st, 5));
119 fail_if(lua_gettop(lst) > 0); 98 fail_if(lua_gettop(lst) > 0);
120 99
100 f = fopen(buf, "wb");
101 fail_if(!f);
102 fprintf(f, "return true");
103 fclose(f);
104 cargv[1] = buf;
121 fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit)); 105 fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit));
122 fail_if(quit != 1); 106 fail_if(quit != 1);
123 107
@@ -125,11 +109,31 @@ EFL_START_TEST(elua_api)
125 fail_if(!f); 109 fail_if(!f);
126 fprintf(f, "return false"); 110 fprintf(f, "return false");
127 fclose(f); 111 fclose(f);
128 cargv[1] = buf;
129 fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit)); 112 fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit));
130 fail_if(quit != 0); 113 fail_if(quit != 0);
131 fail_if(remove(buf)); 114 fail_if(remove(buf));
132 115
116 /* elua API here tries accessing files by relative path,
117 * prevent any unintentional file accesses in cwd
118 */
119 fail_if(chdir(TESTS_SRC_DIR));
120
121 fail_if(!elua_util_require(st, "util"));
122 fail_if(!elua_util_string_run(st, "return 1337", "foo"));
123 fail_if(elua_util_string_run(st, "foo bar", "foo")); /* invalid code */
124 fail_if(elua_util_app_load(st, "test"));
125 fail_if(lua_type(lst, -1) != LUA_TFUNCTION);
126 lua_pop(lst, 1);
127 fail_if(!elua_util_app_load(st, "non_existent_app"));
128 fail_if(lua_type(lst, -1) != LUA_TSTRING);
129 lua_pop(lst, 1);
130 fail_if(elua_io_loadfile(st, ELUA_CORE_DIR "/util.lua"));
131 fail_if(lua_type(lst, -1) != LUA_TFUNCTION);
132 lua_pop(lst, 1);
133 fail_if(!elua_io_loadfile(st, ELUA_CORE_DIR "/non_existent_file.lua"));
134 fail_if(lua_type(lst, -1) != LUA_TSTRING);
135 lua_pop(lst, 1);
136
133 elua_state_free(st); 137 elua_state_free(st);
134} 138}
135EFL_END_TEST 139EFL_END_TEST
diff --git a/src/tests/emotion/emotion_test_main-eo.c b/src/tests/emotion/emotion_test_main-eo.c
index 65508a0..8304979 100644
--- a/src/tests/emotion/emotion_test_main-eo.c
+++ b/src/tests/emotion/emotion_test_main-eo.c
@@ -112,7 +112,7 @@ static void
112bg_setup(void) 112bg_setup(void)
113{ 113{
114 o_bg = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas); 114 o_bg = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas);
115 efl_file_set(o_bg, theme_file, "background"); 115 efl_file_simple_load(o_bg, theme_file, "background");
116 efl_gfx_entity_position_set(o_bg, EINA_POSITION2D(0, 0)); 116 efl_gfx_entity_position_set(o_bg, EINA_POSITION2D(0, 0));
117 efl_gfx_entity_size_set(o_bg, EINA_SIZE2D(startw, starth)); 117 efl_gfx_entity_size_set(o_bg, EINA_SIZE2D(startw, starth));
118 efl_gfx_stack_layer_set(o_bg, -999); 118 efl_gfx_stack_layer_set(o_bg, -999);
@@ -624,7 +624,7 @@ init_video_object(const char *module_filename, const char *filename)
624 oe = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas);