summaryrefslogtreecommitdiff
path: root/src/tests/eldbus/eldbus_test_eldbus_model_signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eldbus/eldbus_test_eldbus_model_signal.c')
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_signal.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c
index 3185f2e..7c31874 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_signal.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_signal.c
@@ -27,12 +27,7 @@ _setup(void)
27 27
28 fake_server = fake_server_start(&fake_server_data); 28 fake_server = fake_server_start(&fake_server_data);
29 29
30 fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, 30 fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, eldbus_model_object_constructor(eoid, ELDBUS_CONNECTION_TYPE_SESSION, NULL, EINA_FALSE, FAKE_SERVER_BUS, FAKE_SERVER_PATH));
31 eldbus_model_object_constructor(ELDBUS_CONNECTION_TYPE_SESSION,
32 NULL,
33 EINA_FALSE,
34 FAKE_SERVER_BUS,
35 FAKE_SERVER_PATH));
36 ck_assert_ptr_ne(NULL, fake_server_object); 31 ck_assert_ptr_ne(NULL, fake_server_object);
37 32
38 efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); 33 efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED);
@@ -68,7 +63,7 @@ START_TEST(properties_get)
68{ 63{
69 Eina_Array *properties = NULL; 64 Eina_Array *properties = NULL;
70 Efl_Model_Load_Status status; 65 Efl_Model_Load_Status status;
71 eo_do(pong_signal, status = efl_model_properties_get(&properties)); 66 status = efl_model_properties_get(pong_signal, &properties);
72 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 67 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
73 ck_assert_ptr_ne(NULL, properties); 68 ck_assert_ptr_ne(NULL, properties);
74 69
@@ -83,12 +78,12 @@ START_TEST(property_get)
83 // Signal properties always have output direction 78 // Signal properties always have output direction
84 Eina_Value const* dummy; 79 Eina_Value const* dummy;
85 Efl_Model_Load_Status status; 80 Efl_Model_Load_Status status;
86 eo_do(pong_signal, status = efl_model_property_get(ARGUMENT_A, &dummy)); 81 status = efl_model_property_get(pong_signal, ARGUMENT_A, &dummy);
87 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 82 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
88 ck_assert_ptr_ne(NULL, dummy); 83 ck_assert_ptr_ne(NULL, dummy);
89 84
90 // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR 85 // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR
91 eo_do(pong_signal, status = efl_model_property_get("nonexistent", &dummy)); 86 status = efl_model_property_get(pong_signal, "nonexistent", &dummy);
92 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 87 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
93} 88}
94END_TEST 89END_TEST
@@ -98,7 +93,7 @@ START_TEST(property_set)
98 // Signals have output arguments only. All returns error 93 // Signals have output arguments only. All returns error
99 Eina_Value dummy = {0}; 94 Eina_Value dummy = {0};
100 Efl_Model_Load_Status status; 95 Efl_Model_Load_Status status;
101 eo_do(pong_signal, status = efl_model_property_set(ARGUMENT_A, &dummy)); 96 status = efl_model_property_set(pong_signal, ARGUMENT_A, &dummy);
102 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 97 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
103} 98}
104END_TEST 99END_TEST
@@ -119,7 +114,7 @@ START_TEST(children_slice_get)
119{ 114{
120 Eina_Accessor *accessor; 115 Eina_Accessor *accessor;
121 Efl_Model_Load_Status status; 116 Efl_Model_Load_Status status;
122 eo_do(pong_signal, status = efl_model_children_slice_get(1, 1, &accessor)); 117 status = efl_model_children_slice_get(pong_signal, 1, 1, &accessor);
123 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 118 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
124 ck_assert_ptr_eq(NULL, accessor); 119 ck_assert_ptr_eq(NULL, accessor);
125} 120}
@@ -129,7 +124,7 @@ static void
129_check_unload(void) 124_check_unload(void)
130{ 125{
131 check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED); 126 check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED);
132 eo_do(pong_signal, efl_model_unload()); 127 efl_model_unload(pong_signal);
133 check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_UNLOADED); 128 check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_UNLOADED);
134 129
135 check_efl_model_children_count_eq(pong_signal, 0); 130 check_efl_model_children_count_eq(pong_signal, 0);
@@ -145,7 +140,7 @@ START_TEST(properties_load)
145{ 140{
146 _check_unload(); 141 _check_unload();
147 142
148 eo_do(pong_signal, efl_model_properties_load()); 143 efl_model_properties_load(pong_signal);
149 efl_model_wait_for_load_status(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); 144 efl_model_wait_for_load_status(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES);
150 145
151 check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); 146 check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES);
@@ -156,7 +151,7 @@ START_TEST(children_load)
156{ 151{
157 _check_unload(); 152 _check_unload();
158 153
159 eo_do(pong_signal, efl_model_children_load()); 154 efl_model_children_load(pong_signal);
160 efl_model_wait_for_load_status(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); 155 efl_model_wait_for_load_status(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN);
161 156
162 check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); 157 check_efl_model_load_status_get(pong_signal, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN);
@@ -168,7 +163,7 @@ END_TEST
168START_TEST(child_add) 163START_TEST(child_add)
169{ 164{
170 Eo *child; 165 Eo *child;
171 eo_do(pong_signal, child = efl_model_child_add()); 166 child = efl_model_child_add(pong_signal);
172 ck_assert_ptr_eq(NULL, child); 167 ck_assert_ptr_eq(NULL, child);
173} 168}
174END_TEST 169END_TEST
@@ -178,7 +173,7 @@ START_TEST(child_del)
178 // efl_model_child_del always returns ERROR 173 // efl_model_child_del always returns ERROR
179 Eo *child = NULL; 174 Eo *child = NULL;
180 Efl_Model_Load_Status status; 175 Efl_Model_Load_Status status;
181 eo_do(pong_signal, status = efl_model_child_del(child)); 176 status = efl_model_child_del(pong_signal, child);
182 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 177 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
183} 178}
184END_TEST 179END_TEST
@@ -193,7 +188,7 @@ START_TEST(signals)
193 check_efl_model_property_int_set(ping_method, ARGUMENT_A, 99); 188 check_efl_model_property_int_set(ping_method, ARGUMENT_A, 99);
194 189
195 Efl_Model_Load_Status status; 190 Efl_Model_Load_Status status;
196 eo_do(ping_method, status = eldbus_model_method_call()); 191 status = eldbus_model_method_call(ping_method);
197 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 192 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
198 193
199 efl_model_wait_for_event(pong_signal, EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED); 194 efl_model_wait_for_event(pong_signal, EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED);