summaryrefslogtreecommitdiff
path: root/src/tests/eio
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2016-03-01 18:06:28 +0000
committerTom Hacohen <tom@stosb.com>2016-03-03 09:58:08 +0000
commitf21ade6123b9053fca8d1632644c48525a99d6e0 (patch)
treec5eb0445f471d21365a7a5a7b0ec7d279c11b398 /src/tests/eio
parent3faf3f3fc68a839f06b311c35ba020cb25e7c9c4 (diff)
Automatic migration to Eo4.
I just ran my script (email to follow) to migrate all of the EFL automatically. This commit is *only* the automatic conversion, so it can be easily reverted and re-run.
Diffstat (limited to 'src/tests/eio')
-rw-r--r--src/tests/eio/eio_model_test_file.c26
-rw-r--r--src/tests/eio/eio_model_test_monitor_add.c26
2 files changed, 26 insertions, 26 deletions
diff --git a/src/tests/eio/eio_model_test_file.c b/src/tests/eio/eio_model_test_file.c
index 56e6dd6ac8..5873d7ab83 100644
--- a/src/tests/eio/eio_model_test_file.c
+++ b/src/tests/eio/eio_model_test_file.c
@@ -84,26 +84,26 @@ _load_status_cb(void *data EINA_UNUSED, const Eo_Event *event)
84 char *str; 84 char *str;
85 85
86 printf("Model is Loaded\n"); 86 printf("Model is Loaded\n");
87 eo_do(event->obj, status = efl_model_property_get("filename", &value_prop)); 87 status = efl_model_property_get(event->obj, "filename", &value_prop);
88 str = eina_value_to_string(value_prop); 88 str = eina_value_to_string(value_prop);
89 printf("efl_model_loaded filename %s, status=%d\n", str, status); 89 printf("efl_model_loaded filename %s, status=%d\n", str, status);
90 free(str); 90 free(str);
91 91
92 eo_do(event->obj, status = efl_model_property_get("size", &value_prop)); 92 status = efl_model_property_get(event->obj, "size", &value_prop);
93 str = eina_value_to_string(value_prop); 93 str = eina_value_to_string(value_prop);
94 printf("efl_model_loaded size %s, status=%d\n", str, status); 94 printf("efl_model_loaded size %s, status=%d\n", str, status);
95 free(str); 95 free(str);
96 96
97 eo_do(event->obj, status = efl_model_property_get("mtime", &value_prop)); 97 status = efl_model_property_get(event->obj, "mtime", &value_prop);
98 str = eina_value_to_string(value_prop); 98 str = eina_value_to_string(value_prop);
99 printf("efl_model_loaded mtime %s, status=%d\n", str, status); 99 printf("efl_model_loaded mtime %s, status=%d\n", str, status);
100 free(str); 100 free(str);
101 101
102 eo_do(event->obj, efl_model_children_count_get(&total)); 102 efl_model_children_count_get(event->obj, &total);
103 printf("efl_model_test count %d\n", (int)total); 103 printf("efl_model_test count %d\n", (int)total);
104 104
105 /**< get full list */ 105 /**< get full list */
106 eo_do(event->obj, status = efl_model_children_slice_get(0 ,0 ,(Eina_Accessor **)&accessor)); 106 status = efl_model_children_slice_get(event->obj, 0, 0, (Eina_Accessor **)&accessor);
107 eina_accessor_free(accessor); 107 eina_accessor_free(accessor);
108 ecore_main_loop_quit(); 108 ecore_main_loop_quit();
109 } 109 }
@@ -143,7 +143,7 @@ _children_count_cb(void *data EINA_UNUSED, const Eo_Event *event)
143 fprintf(stdout, "Children count number=%d\n", *len); 143 fprintf(stdout, "Children count number=%d\n", *len);
144 reqs.children = *len; 144 reqs.children = *len;
145 145
146 eo_do(event->obj, efl_model_children_count_get(&total)); 146 efl_model_children_count_get(event->obj, &total);
147 fprintf(stdout, "New total children count number=%d\n", *len); 147 fprintf(stdout, "New total children count number=%d\n", *len);
148 148
149 return EINA_TRUE; 149 return EINA_TRUE;
@@ -165,27 +165,27 @@ START_TEST(eio_model_test_test_file)
165 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n"); 165 fail_if(!ecore_init(), "ERROR: Cannot init Ecore!\n");
166 fail_if(!eio_init(), "ERROR: Cannot init EIO!\n"); 166 fail_if(!eio_init(), "ERROR: Cannot init EIO!\n");
167 167
168 filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(EFL_MODEL_TEST_FILENAME_PATH)); 168 filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eoid, EFL_MODEL_TEST_FILENAME_PATH));
169 fail_if(!filemodel, "ERROR: Cannot init model!\n"); 169 fail_if(!filemodel, "ERROR: Cannot init model!\n");
170 170
171 eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_status_cb, NULL)); 171 eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_status_cb, NULL);
172 eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED, _properties_change_cb, NULL)); 172 eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED, _properties_change_cb, NULL);
173 eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_CHILDREN_COUNT_CHANGED, _children_count_cb, NULL)); 173 eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_CHILDREN_COUNT_CHANGED, _children_count_cb, NULL);
174 174
175 eo_do(filemodel, efl_model_load()); 175 efl_model_load(filemodel);
176 176
177 handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_func, NULL); 177 handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_func, NULL);
178 178
179 ecore_main_loop_begin(); 179 ecore_main_loop_begin();
180 180
181 eo_do(filemodel, status = efl_model_property_get("filename", &value_prop)); 181 status = efl_model_property_get(filemodel, "filename", &value_prop);
182 str = eina_value_to_string(value_prop); 182 str = eina_value_to_string(value_prop);
183 printf("efl_model_test filename %s, load status %d\n", str, status); 183 printf("efl_model_test filename %s, load status %d\n", str, status);
184 184
185 free(str); 185 free(str);
186 186
187 i = 0; 187 i = 0;
188 eo_do(filemodel, efl_model_properties_get(&properties_list)); 188 efl_model_properties_get(filemodel, &properties_list);
189 EINA_ARRAY_ITER_NEXT(properties_list, i, str, iterator) 189 EINA_ARRAY_ITER_NEXT(properties_list, i, str, iterator)
190 { 190 {
191 fprintf(stdout, "Returned property list %d: %s\n", i, str); 191 fprintf(stdout, "Returned property list %d: %s\n", i, str);
diff --git a/src/tests/eio/eio_model_test_monitor_add.c b/src/tests/eio/eio_model_test_monitor_add.c
index 4f26a8e675..b718edd137 100644
--- a/src/tests/eio/eio_model_test_monitor_add.c
+++ b/src/tests/eio/eio_model_test_monitor_add.c
@@ -29,7 +29,7 @@ _load_monitor_status_cb(void *data, const Eo_Event *event)
29 if (!(st->status & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES)) 29 if (!(st->status & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES))
30 return EINA_TRUE; 30 return EINA_TRUE;
31 31
32 eo_do(event->obj, efl_model_property_get("path", &value_prop)); 32 efl_model_property_get(event->obj, "path", &value_prop);
33 fail_if(!value_prop, "ERROR: Cannot get property!\n"); 33 fail_if(!value_prop, "ERROR: Cannot get property!\n");
34 34
35 str = eina_value_to_string(value_prop); 35 str = eina_value_to_string(value_prop);
@@ -38,9 +38,9 @@ _load_monitor_status_cb(void *data, const Eo_Event *event)
38 if(temp_filename && strcmp(str, temp_filename) == 0) 38 if(temp_filename && strcmp(str, temp_filename) == 0)
39 { 39 {
40 fprintf(stderr, "is child that we want\n"); 40 fprintf(stderr, "is child that we want\n");
41 eo_do(event->obj, eo_event_callback_del(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, data)); 41 eo_event_callback_del(event->obj, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, data);
42 children_added = EINA_TRUE; 42 children_added = EINA_TRUE;
43 eo_do(parent, efl_model_child_del(event->obj)); 43 efl_model_child_del(parent, event->obj);
44 } 44 }
45 45
46 return EINA_FALSE; 46 return EINA_FALSE;
@@ -54,13 +54,13 @@ _children_removed_cb(void *data EINA_UNUSED, const Eo_Event *event)
54 Efl_Model_Children_Event* evt = event->event_info; 54 Efl_Model_Children_Event* evt = event->event_info;
55 55
56 Eina_Bool b; 56 Eina_Bool b;
57 eo_do(evt->child, b = efl_model_load_status_get() & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES); 57 b = efl_model_load_status_get(evt->child);
58 if(b) 58 if(b)
59 { 59 {
60 const Eina_Value* value_prop = NULL; 60 const Eina_Value* value_prop = NULL;
61 const char* str = NULL; 61 const char* str = NULL;
62 62
63 eo_do(evt->child, efl_model_property_get("path", &value_prop)); 63 efl_model_property_get(evt->child, "path", &value_prop);
64 fail_if(!value_prop, "ERROR: Cannot get property!\n"); 64 fail_if(!value_prop, "ERROR: Cannot get property!\n");
65 65
66 str = eina_value_to_string(value_prop); 66 str = eina_value_to_string(value_prop);
@@ -79,8 +79,8 @@ _children_added_cb(void *data EINA_UNUSED, const Eo_Event *event)
79 if (evt == NULL) 79 if (evt == NULL)
80 return EINA_TRUE; 80 return EINA_TRUE;
81 81
82 eo_do(evt->child, eo_event_callback_add(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, event->obj)); 82 eo_event_callback_add(evt->child, EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, event->obj);
83 eo_do(evt->child, efl_model_load()); 83 efl_model_load(evt->child);
84 84
85 return EINA_TRUE; 85 return EINA_TRUE;
86} 86}
@@ -98,7 +98,7 @@ _children_count_cb(void *data EINA_UNUSED, const Eo_Event *event)
98 fprintf(stderr, "Children count number=%d\n", *len); 98 fprintf(stderr, "Children count number=%d\n", *len);
99 99
100 /**< get full list */ 100 /**< get full list */
101 eo_do(event->obj, status = efl_model_children_slice_get(0 ,0 ,(Eina_Accessor **)&accessor)); 101 status = efl_model_children_slice_get(event->obj, 0, 0, (Eina_Accessor **)&accessor);
102 if(accessor != NULL) 102 if(accessor != NULL)
103 { 103 {
104 EINA_ACCESSOR_FOREACH(accessor, i, child) {} 104 EINA_ACCESSOR_FOREACH(accessor, i, child) {}
@@ -125,14 +125,14 @@ START_TEST(eio_model_test_test_monitor_add)
125 125
126 tmpdir = eina_environment_tmp_get(); 126 tmpdir = eina_environment_tmp_get();
127 127
128 filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(tmpdir)); 128 filemodel = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eoid, tmpdir));
129 fail_if(!filemodel, "ERROR: Cannot init model!\n"); 129 fail_if(!filemodel, "ERROR: Cannot init model!\n");
130 130
131 eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_CHILD_ADDED, _children_added_cb, NULL)); 131 eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_CHILD_ADDED, _children_added_cb, NULL);
132 eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_CHILD_REMOVED, _children_removed_cb, NULL)); 132 eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_CHILD_REMOVED, _children_removed_cb, NULL);
133 eo_do(filemodel, eo_event_callback_add(EFL_MODEL_BASE_EVENT_CHILDREN_COUNT_CHANGED, _children_count_cb, NULL)); 133 eo_event_callback_add(filemodel, EFL_MODEL_BASE_EVENT_CHILDREN_COUNT_CHANGED, _children_count_cb, NULL);
134 134
135 eo_do(filemodel, efl_model_load()); 135 efl_model_load(filemodel);
136 136
137 ecore_main_loop_begin(); 137 ecore_main_loop_begin();
138 138