}
}
-static Eina_Bool __layout_file_set(int state)
+static Eina_Bool __layout_file_set(Evas_Object *layout, int state)
{
char file_name[1024];
char *on_off;
ret = access(file_name, 0);
if (ret == 0) {
_D("This Resolution[%d]x[%d] is supported !!", s_animation.w, s_animation.h);
- if (!elm_layout_file_set(s_animation.layout, file_name, on_off)) return EINA_FALSE;
+ if (!elm_layout_file_set(layout, file_name, on_off)) return EINA_FALSE;
} else {
_E("This Resolution[%d]x[%d] is STRANGE !!, Set default image '720x1280'", s_animation.w, s_animation.h);
if (state == TYPE_ON) {
- if (!elm_layout_file_set(s_animation.layout, DEFAULT_ON, on_off)) return EINA_FALSE;
+ if (!elm_layout_file_set(layout, DEFAULT_ON, on_off)) return EINA_FALSE;
} else {
- if (!elm_layout_file_set(s_animation.layout, DEFAULT_OFF, on_off)) return EINA_FALSE;
+ if (!elm_layout_file_set(layout, DEFAULT_OFF, on_off)) return EINA_FALSE;
}
}
return NULL;
}
- ret = __layout_file_set(s_animation.state);
+ ret = __layout_file_set(layout, s_animation.state);
if (ret != EINA_TRUE) {
_E("Failed to set layout file");
evas_object_del(layout);
close(1);
return EXIT_SUCCESS;
}
+
+#if TEST_MODE
+Evas_Object *__t_create_window(void)
+{
+ return __create_window();
+}
+#endif
return 0;
}
#endif
-//ELM_MAIN()
+
+#include "test.h"
+#if TEST_MODE
+int __t__prepare_animation(keynode_t * node, void *user_data)
+{
+ return __prepare_animation(node, user_data);
+}
+#endif
+
--- /dev/null
+#include "test.h"
+#if TEST_MODE
+
+#include "feature_test.h"
+
+#include <Elementary.h>
+
+#define TEST_GROUP_COUNT 0
+
+static void __complete_group_cb(void);
+static void __run_next_group(void);
+
+static struct {
+ int current_group;
+ char group_name[TEST_GROUP_COUNT + 1][128];
+ void(*group_starter_pool[TEST_GROUP_COUNT + 1])(unit_group_t * group);
+} s_info = {
+ .current_group = 0,
+ .group_name = {
+ ""
+ },
+ .group_starter_pool = {
+ NULL,
+ },
+};
+
+static void __complete_group_cb(void)
+{
+ s_info.current_group += 1;
+
+ __run_next_group();
+}
+
+static void __run_next_group(void)
+{
+ if (s_info.group_starter_pool[s_info.current_group] == NULL) {
+ return ;
+ }
+
+ TEST_GROUP(s_info.group_name[s_info.current_group], s_info.group_starter_pool[s_info.current_group], __complete_group_cb);
+}
+
+void feature_test(void)
+{
+ unit_clear_log();
+
+ s_info.current_group = 0;
+
+ __run_next_group();
+}
+
+#endif
+
--- /dev/null
+#ifndef __FEATURE_TEST__
+#define __FEATURE_TEST__
+
+#include "test.h"
+#if TEST_MODE
+
+#include "../unit/inc/unit.h"
+
+#include <app.h>
+
+void feature_test(void);
+
+#endif
+
+#endif
--- /dev/null
+#include "test.h"
+#if TEST_MODE
+
+#include "function_test.h"
+
+#define TEST_GROUP_COUNT 1
+
+static struct {
+ int current_group;
+ char group_name[TEST_GROUP_COUNT + 1][128];
+ void(*group_starter_pool[TEST_GROUP_COUNT + 1])(unit_group_t * group);
+} s_info = {
+ .current_group = 0,
+ .group_name = {
+ "group_function_create_window",
+ ""
+ },
+ .group_starter_pool = {
+ group_function_create_window,
+ NULL,
+ },
+};
+
+static void __complete_group_cb(void);
+static void __run_next_group(void);
+
+static void __complete_group_cb(void)
+{
+ s_info.current_group += 1;
+
+ __run_next_group();
+}
+
+static void __run_next_group(void)
+{
+ if (s_info.group_starter_pool[s_info.current_group]) {
+ TEST_GROUP(s_info.group_name[s_info.current_group], s_info.group_starter_pool[s_info.current_group], __complete_group_cb);
+ }
+}
+
+void function_test(void)
+{
+ unit_clear_log();
+
+ s_info.current_group = 0;
+ __run_next_group();
+}
+
+#endif
--- /dev/null
+#ifndef __FUNCTION_TEST__
+#define __FUNCTION_TEST__
+
+#include "test.h"
+#if TEST_MODE
+
+#include "../unit/inc/unit.h"
+
+void function_test(void);
+void group_function_create_window(unit_group_t * group);
+
+#endif
+
+#endif
--- /dev/null
+#include "test.h"
+#if TEST_MODE
+
+#include "function_test.h"
+#include <Elementary.h>
+
+static void __set_up(void){}
+static void __tear_down(void){}
+
+static void __case_create_win(bool * is_passed)
+{
+ Evas_Object *win = __t_create_window();
+
+ *is_passed = true;
+}
+
+void group_function_create_window(unit_group_t * group)
+{
+ TEST_CASE(group, __case_create_win);
+
+ group->finish(group);
+}
+
+#endif
#include "../inc/test.h"
#if (TEST_MODE == TEST_APP)
-//#include "control/app_manager.h"
-
#include "unit/inc/unit.h"
-//#include "function_test/function_test.h"
-//#include "feature_test/feature_test.h"
+#include "function_test/function_test.h"
+#include "feature_test/feature_test.h"
+#include "animation.h"
#include <Elementary.h>
+#include <vconf.h>
+
+extern int __t__prepare_animation(keynode_t * node, void *user_data);
static struct {
Ecore_Timer * feature_test_run_timer;
.feature_test_run_timer = NULL,
};
-static Eina_Bool __run_timer_callback(void * data);
-
-static bool __create(void * data)
-{
- if (s_info.feature_test_run_timer) {
- ecore_timer_del(s_info.feature_test_run_timer);
- s_info.feature_test_run_timer = NULL;
- }
-
- s_info.feature_test_run_timer = ecore_timer_add(0.7, __run_timer_callback, NULL);
-
- return true;
-}
-
-static void __app_control(app_control_h app_control_handle, void * data)
-{
- return;
-}
-
-static void __resume(void * data)
-{
- return;
-}
-
-static void __pause(void * data)
-{
- return;
-}
-
-static void __terminate(void * data)
-{
- return;
-}
-
static Eina_Bool __run_timer_callback(void * data)
{
s_info.feature_test_run_timer = NULL;
return ECORE_CALLBACK_CANCEL;
}
+struct args {
+ int argc;
+ char **argv;
+ char *msg;
+};
+
int main(int argc, char *argv[])
{
unit_init();
- //function_test();
-
- ui_app_lifecycle_callback_s lifecycle_callback = {NULL, };
+ elm_init(argc, argv);
- lifecycle_callback.create = __create;
- lifecycle_callback.app_control = __app_control;
- lifecycle_callback.resume = __resume;
- lifecycle_callback.pause = __pause;
- lifecycle_callback.terminate = __terminate;
+ function_test();
- int ret = ui_app_main(argc, argv, &lifecycle_callback, NULL);
- if (ret != APP_ERROR_NONE) {
- __T("app_main() is failed. err = %d", ret);
- }
+ init_animation(1, NULL);
+
+ elm_run();
unit_fini();
-
return 0;
}