summaryrefslogtreecommitdiff
path: root/src/tests/eldbus/eldbus_test_eldbus_model_object.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/eldbus/eldbus_test_eldbus_model_object.c')
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model_object.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model_object.c b/src/tests/eldbus/eldbus_test_eldbus_model_object.c
index c1f1248..faa64a7 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model_object.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model_object.c
@@ -43,7 +43,7 @@ START_TEST(properties_get)
43{ 43{
44 Eina_Array *properties = NULL; 44 Eina_Array *properties = NULL;
45 Efl_Model_Load_Status status; 45 Efl_Model_Load_Status status;
46 eo_do(object, status = efl_model_properties_get(&properties)); 46 status = efl_model_properties_get(object, &properties);
47 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 47 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
48 ck_assert_ptr_ne(NULL, properties); 48 ck_assert_ptr_ne(NULL, properties);
49 49
@@ -52,7 +52,7 @@ START_TEST(properties_get)
52 ck_assert_int_eq(expected_properties_count, actual_properties_count); 52 ck_assert_int_eq(expected_properties_count, actual_properties_count);
53 53
54 // Unloaded object populates its properties 54 // Unloaded object populates its properties
55 eo_do(unloaded_object, status = efl_model_properties_get(&properties)); 55 status = efl_model_properties_get(unloaded_object, &properties);
56 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); 56 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status);
57 ck_assert_ptr_ne(NULL, properties); 57 ck_assert_ptr_ne(NULL, properties);
58 58
@@ -65,11 +65,11 @@ START_TEST(property_get)
65{ 65{
66 const Eina_Value* property_value; 66 const Eina_Value* property_value;
67 Efl_Model_Load_Status status; 67 Efl_Model_Load_Status status;
68 eo_do(object, status = efl_model_property_get(UNIQUE_NAME_PROPERTY, &property_value)); 68 status = efl_model_property_get(object, UNIQUE_NAME_PROPERTY, &property_value);
69 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 69 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
70 70
71 // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR 71 // Nonexistent property must return EFL_MODEL_LOAD_STATUS_ERROR
72 eo_do(object, status = efl_model_property_get("nonexistent", &property_value)); 72 status = efl_model_property_get(object, "nonexistent", &property_value);
73 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 73 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
74} 74}
75END_TEST 75END_TEST
@@ -81,19 +81,19 @@ START_TEST(property_set)
81 eina_value_setup(&value, EINA_VALUE_TYPE_INT); 81 eina_value_setup(&value, EINA_VALUE_TYPE_INT);
82 eina_value_set(&value, 1); 82 eina_value_set(&value, 1);
83 Efl_Model_Load_Status status; 83 Efl_Model_Load_Status status;
84 eo_do(object, status = efl_model_property_set("nonexistent", &value)); 84 status = efl_model_property_set(object, "nonexistent", &value);
85 eina_value_flush(&value); 85 eina_value_flush(&value);
86 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 86 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
87 87
88 // UNIQUE_NAME_PROPERTY is read-only 88 // UNIQUE_NAME_PROPERTY is read-only
89 eo_do(object, status = efl_model_property_set(UNIQUE_NAME_PROPERTY, &value)); 89 status = efl_model_property_set(object, UNIQUE_NAME_PROPERTY, &value);
90 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 90 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
91 91
92 // The model must be loaded to be able to set its properties 92 // The model must be loaded to be able to set its properties
93 const char *expected_value = "unloaded"; 93 const char *expected_value = "unloaded";
94 eina_value_setup(&value, EINA_VALUE_TYPE_STRING); 94 eina_value_setup(&value, EINA_VALUE_TYPE_STRING);
95 eina_value_set(&value, expected_value); 95 eina_value_set(&value, expected_value);
96 eo_do(unloaded_object, status = efl_model_property_set(UNIQUE_NAME_PROPERTY, &value)); 96 status = efl_model_property_set(unloaded_object, UNIQUE_NAME_PROPERTY, &value);
97 eina_value_flush(&value); 97 eina_value_flush(&value);
98 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 98 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
99} 99}
@@ -119,7 +119,7 @@ START_TEST(children_slice_get)
119 // Unloaded object must return EFL_MODEL_LOAD_STATUS_UNLOADED 119 // Unloaded object must return EFL_MODEL_LOAD_STATUS_UNLOADED
120 Eina_Accessor *accessor; 120 Eina_Accessor *accessor;
121 Efl_Model_Load_Status status; 121 Efl_Model_Load_Status status;
122 eo_do(unloaded_object, status = efl_model_children_slice_get(0, 0, &accessor)); 122 status = efl_model_children_slice_get(unloaded_object, 0, 0, &accessor);
123 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status); 123 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_UNLOADED, status);
124 ck_assert_ptr_eq(NULL, accessor); 124 ck_assert_ptr_eq(NULL, accessor);
125} 125}
@@ -128,7 +128,7 @@ END_TEST
128START_TEST(unload) 128START_TEST(unload)
129{ 129{
130 check_efl_model_load_status_get(object, EFL_MODEL_LOAD_STATUS_LOADED); 130 check_efl_model_load_status_get(object, EFL_MODEL_LOAD_STATUS_LOADED);
131 eo_do(object, efl_model_unload()); 131 efl_model_unload(object);
132 check_efl_model_load_status_get(object, EFL_MODEL_LOAD_STATUS_UNLOADED); 132 check_efl_model_load_status_get(object, EFL_MODEL_LOAD_STATUS_UNLOADED);
133 133
134 check_efl_model_children_count_eq(object, 0); 134 check_efl_model_children_count_eq(object, 0);
@@ -137,14 +137,14 @@ END_TEST
137 137
138START_TEST(properties_load) 138START_TEST(properties_load)
139{ 139{
140 eo_do(unloaded_object, efl_model_properties_load()); 140 efl_model_properties_load(unloaded_object);
141 check_efl_model_load_status_get(unloaded_object, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); 141 check_efl_model_load_status_get(unloaded_object, EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES);
142} 142}
143END_TEST 143END_TEST
144 144
145START_TEST(children_load) 145START_TEST(children_load)
146{ 146{
147 eo_do(unloaded_object, efl_model_children_load()); 147 efl_model_children_load(unloaded_object);
148 148
149 check_efl_model_load_status_get(unloaded_object, EFL_MODEL_LOAD_STATUS_LOADING_CHILDREN); 149 check_efl_model_load_status_get(unloaded_object, EFL_MODEL_LOAD_STATUS_LOADING_CHILDREN);
150 150
@@ -159,7 +159,7 @@ END_TEST
159START_TEST(child_add) 159START_TEST(child_add)
160{ 160{
161 Eo *child; 161 Eo *child;
162 eo_do(object, child = efl_model_child_add()); 162 child = efl_model_child_add(object);
163 ck_assert_ptr_eq(NULL, child); 163 ck_assert_ptr_eq(NULL, child);
164} 164}
165END_TEST 165END_TEST
@@ -168,15 +168,15 @@ START_TEST(child_del)
168{ 168{
169 unsigned int expected_children_count = 0; 169 unsigned int expected_children_count = 0;
170 Efl_Model_Load_Status status; 170 Efl_Model_Load_Status status;
171 eo_do(object, status = efl_model_children_count_get(&expected_children_count)); 171 status = efl_model_children_count_get(object, &expected_children_count);
172 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 172 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
173 173
174 Eo *child = efl_model_first_child_get(object); 174 Eo *child = efl_model_first_child_get(object);
175 eo_do(object, status = efl_model_child_del(child)); 175 status = efl_model_child_del(object, child);
176 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status); 176 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_ERROR, status);
177 177
178 unsigned int actual_children_count = 0; 178 unsigned int actual_children_count = 0;
179 eo_do(object, status = efl_model_children_count_get(&actual_children_count)); 179 status = efl_model_children_count_get(object, &actual_children_count);
180 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status); 180 ck_assert_int_eq(EFL_MODEL_LOAD_STATUS_LOADED, status);
181 181
182 ck_assert_int_le(expected_children_count, actual_children_count); 182 ck_assert_int_le(expected_children_count, actual_children_count);