summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2018-11-23 16:25:19 +0000
committerCedric BAIL <cedric@osg.samsung.com>2018-11-23 10:13:58 -0800
commitd4d44d76f3efef4d61edb4cce7152284915a12d2 (patch)
tree502779c9047c6a8e02c8466f81ddc8616887fa50 /src/tests
parentaac7d099a17d69f5989481f8999a43d4173005bd (diff)
efl: make Efl.Model.properties_get return an Iterator<string>.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D7289
Diffstat (limited to '')
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_connection.c10
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_method.c9
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_object.c9
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_proxy.c3
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_signal.c9
-rw-r--r--src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c9
6 files changed, 38 insertions, 11 deletions
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_connection.c b/src/tests/eldbus/eldbus_test_eldbus_model_connection.c
index aa3e710516..4e57c75d43 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_connection.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_connection.c
@@ -29,12 +29,18 @@ _teardown(void)
29 29
30EFL_START_TEST(properties_get) 30EFL_START_TEST(properties_get)
31{ 31{
32 const Eina_Array *properties = NULL; 32 Eina_Iterator *properties = NULL;
33 properties = efl_model_properties_get(connection); 33 properties = efl_model_properties_get(connection);
34 ck_assert_ptr_ne(NULL, properties); 34 ck_assert_ptr_ne(NULL, properties);
35 35
36 const unsigned int expected_properties_count = 1; 36 const unsigned int expected_properties_count = 1;
37 unsigned int actual_properties_count = eina_array_count(properties); 37 unsigned int actual_properties_count = 0;
38 const char *prop;
39
40 EINA_ITERATOR_FOREACH(properties, prop)
41 actual_properties_count++;
42 eina_iterator_free(properties);
43
38 ck_assert_int_eq(expected_properties_count, actual_properties_count); 44 ck_assert_int_eq(expected_properties_count, actual_properties_count);
39} 45}
40EFL_END_TEST 46EFL_END_TEST
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_method.c b/src/tests/eldbus/eldbus_test_eldbus_model_method.c
index f252fbca7d..1ac32f108e 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_method.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_method.c
@@ -52,12 +52,17 @@ _teardown(void)
52 52
53EFL_START_TEST(properties_get) 53EFL_START_TEST(properties_get)
54{ 54{
55 const Eina_Array *properties = NULL; 55 Eina_Iterator *properties = NULL;
56 properties = efl_model_properties_get(method); 56 properties = efl_model_properties_get(method);
57 ck_assert_ptr_ne(NULL, properties); 57 ck_assert_ptr_ne(NULL, properties);
58 58
59 const unsigned int expected_properties_count = 3; // a, b and result arguments of 'sum' method 59 const unsigned int expected_properties_count = 3; // a, b and result arguments of 'sum' method
60 const unsigned int actual_properties_count = eina_array_count(properties); 60 unsigned int actual_properties_count = 0;
61 const char *prop;
62
63 EINA_ITERATOR_FOREACH(properties, prop)
64 actual_properties_count++;
65 eina_iterator_free(properties);
61 ck_assert_int_eq(expected_properties_count, actual_properties_count); 66 ck_assert_int_eq(expected_properties_count, actual_properties_count);
62} 67}
63EFL_END_TEST 68EFL_END_TEST
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_object.c b/src/tests/eldbus/eldbus_test_eldbus_model_object.c
index 7959a2eb66..e7539eb265 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_object.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_object.c
@@ -29,12 +29,17 @@ _teardown(void)
29 29
30EFL_START_TEST(properties_get) 30EFL_START_TEST(properties_get)
31{ 31{
32 const Eina_Array *properties = NULL; 32 Eina_Iterator *properties = NULL;
33 properties = efl_model_properties_get(object); 33 properties = efl_model_properties_get(object);
34 ck_assert_ptr_ne(NULL, properties); 34 ck_assert_ptr_ne(NULL, properties);
35 35
36 const unsigned int expected_properties_count = 1; 36 const unsigned int expected_properties_count = 1;
37 unsigned int actual_properties_count = eina_array_count(properties); 37 unsigned int actual_properties_count = 0;
38 const char *prop;
39
40 EINA_ITERATOR_FOREACH(properties, prop)
41 actual_properties_count++;
42 eina_iterator_free(properties);
38 ck_assert_int_eq(expected_properties_count, actual_properties_count); 43 ck_assert_int_eq(expected_properties_count, actual_properties_count);
39} 44}
40EFL_END_TEST 45EFL_END_TEST
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c b/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c
index d9665142a2..dabe81fca8 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_proxy.c
@@ -54,7 +54,7 @@ _teardown(void)
54 54
55EFL_START_TEST(properties_get) 55EFL_START_TEST(properties_get)
56{ 56{
57 const Eina_Array *properties = NULL; 57 Eina_Iterator *properties = NULL;
58 // ELDBUS_FDO_INTERFACE have no properties 58 // ELDBUS_FDO_INTERFACE have no properties
59 properties = efl_model_properties_get(dbus_proxy); 59 properties = efl_model_properties_get(dbus_proxy);
60 ck_assert_ptr_ne(NULL, properties); 60 ck_assert_ptr_ne(NULL, properties);
@@ -63,6 +63,7 @@ EFL_START_TEST(properties_get)
63 // due to an EFL change, but a change in the DBus interface: 63 // due to an EFL change, but a change in the DBus interface:
64 // properties contains 2 properties, "Interfaces" and "Features". 64 // properties contains 2 properties, "Interfaces" and "Features".
65 //ck_assert_int_eq(0, eina_array_count(properties)); 65 //ck_assert_int_eq(0, eina_array_count(properties));
66 eina_iterator_free(properties);
66} 67}
67EFL_END_TEST 68EFL_END_TEST
68 69
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c
index f896792bf6..7651e02687 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c
@@ -51,12 +51,17 @@ _teardown(void)
51 51
52EFL_START_TEST(properties_get) 52EFL_START_TEST(properties_get)
53{ 53{
54 const Eina_Array *properties = NULL; 54 Eina_Iterator *properties = NULL;
55 properties = efl_model_properties_get(pong_signal); 55 properties = efl_model_properties_get(pong_signal);
56 ck_assert_ptr_ne(NULL, properties); 56 ck_assert_ptr_ne(NULL, properties);
57 57
58 const unsigned int expected_properties_count = 1; // 'response' only 58 const unsigned int expected_properties_count = 1; // 'response' only
59 const unsigned int actual_properties_count = eina_array_count(properties); 59 unsigned int actual_properties_count = 0;
60 const char *prop;
61
62 EINA_ITERATOR_FOREACH(properties, prop)
63 actual_properties_count += 1;
64 eina_iterator_free(properties);
60 ck_assert_int_eq(expected_properties_count, actual_properties_count); 65 ck_assert_int_eq(expected_properties_count, actual_properties_count);
61} 66}
62EFL_END_TEST 67EFL_END_TEST
diff --git a/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c b/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c
index 81d35df609..69cf8bafc9 100644
--- a/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c
+++ b/src/tests/eldbus/eldbus_test_fake_server_eldbus_model_proxy.c
@@ -52,12 +52,17 @@ _teardown(void)
52 52
53EFL_START_TEST(properties_get) 53EFL_START_TEST(properties_get)
54{ 54{
55 const Eina_Array *properties = efl_model_properties_get(fake_server_proxy); 55 Eina_Iterator *properties = efl_model_properties_get(fake_server_proxy);
56 ck_assert_ptr_ne(NULL, properties); 56 ck_assert_ptr_ne(NULL, properties);
57 57
58 // FAKE_SERVER_READONLY_PROPERTY, FAKE_SERVER_WRITEONLY_PROPERTY and FAKE_SERVER_READWRITE_PROPERTY properties 58 // FAKE_SERVER_READONLY_PROPERTY, FAKE_SERVER_WRITEONLY_PROPERTY and FAKE_SERVER_READWRITE_PROPERTY properties
59 const unsigned int expected_properties_count = 3; 59 const unsigned int expected_properties_count = 3;
60 const unsigned int actual_properties_count = eina_array_count(properties); 60 unsigned int actual_properties_count = 0;
61 const char *prop;
62
63 EINA_ITERATOR_FOREACH(properties, prop)
64 actual_properties_count++;
65 eina_iterator_free(properties);
61 ck_assert_int_eq(expected_properties_count, actual_properties_count); 66 ck_assert_int_eq(expected_properties_count, actual_properties_count);
62 67
63 _teardown(); 68 _teardown();