summaryrefslogtreecommitdiff
path: root/src/tests/eldbus/eldbus_test_eldbus_model_method.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eldbus/eldbus_test_eldbus_model_method.c')
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_method.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_method.c b/src/tests/eldbus/eldbus_test_eldbus_model_method.c
index e4f7a81..51ed4af 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_method.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_method.c
@@ -29,12 +29,7 @@ _setup(void)
29 29
30 fake_server = fake_server_start(&fake_server_data); 30 fake_server = fake_server_start(&fake_server_data);
31 31
32 fake_server_object = eo_add(ELDBUS_MODEL_OBJECT_CLASS, NULL, 32 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));
33 eldbus_model_object_constructor(ELDBUS_CONNECTION_TYPE_SESSION,
34 NULL,
35 EINA_FALSE,
36 FAKE_SERVER_BUS,
37 FAKE_SERVER_PATH));
38 ck_assert_ptr_ne(NULL, fake_server_object); 33 ck_assert_ptr_ne(NULL, fake_server_object);
39 34
40 efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED); 35 efl_model_load_and_wait_for_load_status(fake_server_object, EFL_MODEL_LOAD_STATUS_LOADED);
@@ -70,7 +65,7 @@ START_TEST(properties_get)
70{ 65{
71 Eina_Array *properties = NULL; 66 Eina_Array *properties = NULL;
72 Efl_Model_Load_Status status; 67 Efl_Model_Load_Status status;
73 eo_do(method, status = efl_model_properties_get(&properties)); 68 status = efl_model_properties_get(method, &properties);
74 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 69 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
75 ck_assert_ptr_ne(NULL, properties); 70 ck_assert_ptr_ne(NULL, properties);
76 71
@@ -85,14 +80,14 @@ START_TEST(property_get)
85 // Input only property returns error 80 // Input only property returns error
86 Eina_Value const* dummy; 81 Eina_Value const* dummy;
87 Efl_Model_Load_Status status; 82 Efl_Model_Load_Status status;
88 eo_do(method, status = efl_model_property_get(ARGUMENT_A, &dummy)); 83 status = efl_model_property_get(method, ARGUMENT_A, &dummy);
89 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 84 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
90 85
91 eo_do(method, status = efl_model_property_get(ARGUMENT_RESULT, &dummy)); 86 status = efl_model_property_get(method, ARGUMENT_RESULT, &dummy);
92 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 87 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
93 88
94 // Nonexistent property returns error 89 // Nonexistent property returns error
95 eo_do(method, status = efl_model_property_get("nonexistent", &dummy)); 90 status = efl_model_property_get(method, "nonexistent", &dummy);
96 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 91 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
97} 92}
98END_TEST 93END_TEST
@@ -102,7 +97,7 @@ START_TEST(property_set)
102 // Output argument returns error 97 // Output argument returns error
103 Eina_Value dummy = {0}; 98 Eina_Value dummy = {0};
104 Efl_Model_Load_Status status; 99 Efl_Model_Load_Status status;
105 eo_do(method, status = efl_model_property_set(ARGUMENT_RESULT, &dummy)); 100 status = efl_model_property_set(method, ARGUMENT_RESULT, &dummy);
106 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 101 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
107} 102}
108END_TEST 103END_TEST
@@ -123,7 +118,7 @@ START_TEST(children_slice_get)
123{ 118{
124 Eina_Accessor *accessor; 119 Eina_Accessor *accessor;
125 Efl_Model_Load_Status status; 120 Efl_Model_Load_Status status;
126 eo_do(method, status = efl_model_children_slice_get(1, 1, &accessor)); 121 status = efl_model_children_slice_get(method, 1, 1, &accessor);
127 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 122 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
128 ck_assert_ptr_eq(NULL, accessor); 123 ck_assert_ptr_eq(NULL, accessor);
129} 124}
@@ -133,7 +128,7 @@ static void
133_check_unload(void) 128_check_unload(void)
134{ 129{
135 check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED); 130 check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED);
136 eo_do(method, efl_model_unload()); 131 efl_model_unload(method);
137 check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_UNLOADED); 132 check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_UNLOADED);
138 133
139 check_efl_model_children_count_eq(method, 0); 134 check_efl_model_children_count_eq(method, 0);
@@ -149,7 +144,7 @@ START_TEST(properties_load)
149{ 144{
150 _check_unload(); 145 _check_unload();
151 146
152 eo_do(method, efl_model_properties_load()); 147 efl_model_properties_load(method);
153 efl_model_wait_for_load_status(method, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); 148 efl_model_wait_for_load_status(method, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES);
154 149
155 check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); 150 check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES);
@@ -160,7 +155,7 @@ START_TEST(children_load)
160{ 155{
161 _check_unload(); 156 _check_unload();
162 157
163 eo_do(method, efl_model_children_load()); 158 efl_model_children_load(method);
164 efl_model_wait_for_load_status(method, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); 159 efl_model_wait_for_load_status(method, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN);
165 160
166 check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN); 161 check_efl_model_load_status_get(method, EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN);
@@ -172,7 +167,7 @@ END_TEST
172START_TEST(child_add) 167START_TEST(child_add)
173{ 168{
174 Eo *child; 169 Eo *child;
175 eo_do(method, child = efl_model_child_add()); 170 child = efl_model_child_add(method);
176 ck_assert_ptr_eq(NULL, child); 171 ck_assert_ptr_eq(NULL, child);
177} 172}
178END_TEST 173END_TEST
@@ -182,7 +177,7 @@ START_TEST(child_del)
182 // efl_model_child_del always returns ERROR 177 // efl_model_child_del always returns ERROR
183 Eo *child = NULL; 178 Eo *child = NULL;
184 Efl_Model_Load_Status status; 179 Efl_Model_Load_Status status;
185 eo_do(method, status = efl_model_child_del(child)); 180 status = efl_model_child_del(method, child);
186 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 181 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
187} 182}
188END_TEST 183END_TEST
@@ -193,7 +188,7 @@ START_TEST(call)
193 check_efl_model_property_int_set(method, ARGUMENT_B, 87654321); 188 check_efl_model_property_int_set(method, ARGUMENT_B, 87654321);
194 189
195 Efl_Model_Load_Status status; 190 Efl_Model_Load_Status status;
196 eo_do(method, status = eldbus_model_method_call()); 191 status = eldbus_model_method_call(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(method, ELDBUS_MODEL_METHOD_EVENT_SUCCESSFUL_CALL); 194 efl_model_wait_for_event(method, ELDBUS_MODEL_METHOD_EVENT_SUCCESSFUL_CALL);