af7971fb2fb40ccc5fee01cdcd6736ab5df9c8d1
[profile/mobile/apps/native/homescreen-efl.git] / test / test_main.c
1 #include "../inc/test.h"
2 #if (TEST_MODE == TEST_APP)
3
4 #include "unit/inc/unit.h"
5 #include "app_log.h"
6 #include "homescreen-efl.h"
7
8 static void __test_app_resume_cb(void *data)
9 {
10         __homescreen_efl_app_resume_cb(data);
11 }
12
13 int main(int argc, char *argv[])
14 {
15
16         unit_init();
17
18         // test go go
19         __D("Starting homescreen-efl");
20
21         int ret = 0;
22         ui_app_lifecycle_callback_s event_callback = {0,};
23         app_event_handler_h handlers[5] = {NULL, };
24
25         event_callback.create = __homescreen_efl_app_create_cb;
26         event_callback.terminate = __homescreen_efl_app_terminate_cb;
27         event_callback.pause = __homescreen_efl_app_pause_cb;
28         event_callback.resume = __test_app_resume_cb;
29         event_callback.app_control = __homescreen_efl_app_control_cb;
30
31         ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, __homescreen_efl_low_battery_cb, NULL);
32         ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, __homescreen_efl_low_memory_cb, NULL);
33         ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, __homescreen_efl_orient_changed_cb, NULL);
34         ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, __homescreen_efl_lang_changed_cb, NULL);
35         ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, __homescreen_efl_region_changed_cb, NULL);
36
37         ret = ui_app_main(argc, argv, &event_callback, NULL);
38         if (ret != APP_ERROR_NONE)
39                 __E("ui_app_main() is failed. err = %d", ret);
40
41         //main_info.view_type = HOMESCREEN_VIEW_HOME;
42
43         unit_fini();
44
45         return ret;
46 }
47
48 #endif