--- /dev/null
+/**************************************************************************
+ *
+ * Copyright 2016 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * Konstantin Drabeniuk <k.drabeniuk@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+**************************************************************************/
+#include "gtest/gtest.h"
+
+#include "pthread_stubs.h"
+#include "stdlib_stubs.h"
+
+extern int EOM_WAYLEND_ERROR;
+extern int EOM_WAYLEND_RET_ERROR;
+extern int EOM_WAYLAND_CLIENT_INIT_ERROR;
+
+#define pthread_mutex_lock ut_pthread_mutex_lock
+#define calloc ut_calloc
+#define free ut_free
+#define pthread_mutex_init ut_pthread_mutex_init
+#define pthread_mutex_unlock ut_pthread_mutex_unlock
+
+#include "eom.c"
+
+/* HELPER FUNCTIONS */
+
+void ut_eom_cb(eom_output_id output_id, void *user_data) {}
+
+void ut_eom_cb1(eom_output_id output_id, void *user_data) {}
+
+static void _init_test()
+{
+ EOM_WAYLEND_ERROR = 0;
+ EOM_WAYLEND_RET_ERROR = 0;
+ EOM_WAYLAND_CLIENT_INIT_ERROR = 0;
+ PTHREAD_MUTEX_INIT_ERROR = 0;
+ CALLOC_ERROR = 0;
+ CALLOC_RETURN_BUFFER = 0;
+ FREE_CALLED = 0;
+ FREE_PTR = NULL;
+ FREE_TESTED_PTR = NULL;
+ free_called_for_tested_ptr = 0;
+ free_call_count = 0;
+ output_info_list = NULL;
+ cb_info_list = NULL;
+
+ set_last_result(EOM_ERROR_NONE);
+}
+
+/* eom_set_output_window() */
+
+TEST(eom_set_output_window, work_flow_success_5)
+{
+ eom_output_id output_id = 1;
+ eom_error_e error = EOM_ERROR_MESSAGE_OPERATION_FAILURE;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ Evas_Object *win = (Evas_Object *)25;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+
+ error = eom_set_output_window(output_id, win);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_window, work_flow_success_4)
+{
+ eom_output_id output_id = 1;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_MESSAGE_OPERATION_FAILURE;
+ Evas_Object *win = (Evas_Object *)25;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+ EOM_WAYLEND_RET_ERROR = 1;
+
+ error = eom_set_output_window(output_id, win);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_window, work_flow_success_3)
+{
+ eom_output_id output_id = 1;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_MESSAGE_SENDING_FAILURE;
+ Evas_Object *win = (Evas_Object *)25;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+ EOM_WAYLEND_ERROR = 1;
+
+ error = eom_set_output_window(output_id, win);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_window, work_flow_success_2)
+{
+ eom_output_id output_id = 1;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_NO_SUCH_DEVICE;
+ Evas_Object *win = (Evas_Object *)25;
+
+ _init_test();
+
+ error = eom_set_output_window(output_id, win);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_window, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ Evas_Object *win = (Evas_Object *)25;
+
+ _init_test();
+
+ error = eom_set_output_window(0, win);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_window, null_ptr_fail_1)
+{
+ eom_output_id output_id = 1;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_set_output_window(output_id, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_get_output_physical_size() */
+
+TEST(eom_get_output_physical_size, work_flow_success_3)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ int phy_width = 0;
+ int phy_height = 0;
+ int expected_phy_width = 1024;
+ int expected_phy_height = 768;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ output_info.mm_width = expected_phy_width;
+ output_info.mm_height = expected_phy_height;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+
+ error = eom_get_output_physical_size(output_id, &phy_width, &phy_height);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+ ASSERT_EQ(phy_width, expected_phy_width);
+ ASSERT_EQ(phy_height, expected_phy_height);
+}
+
+TEST(eom_get_output_physical_size, work_flow_success_2)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_NO_SUCH_DEVICE;
+
+ _init_test();
+
+ error = eom_get_output_physical_size(output_id, NULL, NULL);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+TEST(eom_get_output_physical_size, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_get_output_physical_size(0, NULL, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_get_output_resolution() */
+
+TEST(eom_get_output_resolution, work_flow_success_3)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ int width = 0;
+ int height = 0;
+ int expected_width = 1024;
+ int expected_height = 768;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ output_info.width = expected_width;
+ output_info.height = expected_height;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+
+ error = eom_get_output_resolution(output_id, &width, &height);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+ ASSERT_EQ(width, expected_width);
+ ASSERT_EQ(height, expected_height);
+}
+
+TEST(eom_get_output_resolution, work_flow_success_2)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_NO_SUCH_DEVICE;
+
+ _init_test();
+
+ error = eom_get_output_resolution(output_id, NULL, NULL);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+TEST(eom_get_output_resolution, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_get_output_resolution(0, NULL, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_get_output_attribute_state() */
+
+TEST(eom_get_output_attribute_state, work_flow_success_3)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_attribute_state_e state = EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
+ eom_output_attribute_state_e expected_state = EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ output_info.state = expected_state;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+
+ error = eom_get_output_attribute_state(output_id, &state);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+ ASSERT_EQ(state, expected_state);
+}
+
+TEST(eom_get_output_attribute_state, work_flow_success_2)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_output_attribute_state_e state;
+
+ _init_test();
+
+ error = eom_get_output_attribute_state(output_id, &state);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+TEST(eom_get_output_attribute_state, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_attribute_state_e state;
+
+ _init_test();
+
+ error = eom_get_output_attribute_state(0, &state);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_get_output_attribute() */
+
+TEST(eom_get_output_attribute, work_flow_success_3)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_attribute_e attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
+ eom_output_attribute_e expected_attribute = EOM_OUTPUT_ATTRIBUTE_NORMAL;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ output_info.attribute = expected_attribute;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+
+ error = eom_get_output_attribute(output_id, &attribute);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+ ASSERT_EQ(attribute, expected_attribute);
+}
+
+TEST(eom_get_output_attribute, work_flow_success_2)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_output_attribute_e attribute;
+
+ _init_test();
+
+ error = eom_get_output_attribute(output_id, &attribute);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+TEST(eom_get_output_attribute, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_attribute_e attribute;
+
+ _init_test();
+
+ error = eom_get_output_attribute(0, &attribute);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_get_output_mode() */
+
+TEST(eom_get_output_mode, work_flow_success_3)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_mode_e mode = EOM_OUTPUT_MODE_NONE;
+ eom_output_mode_e expected_mode = EOM_OUTPUT_MODE_MIRROR;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ output_info.output_mode = expected_mode;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+
+ error = eom_get_output_mode(output_id, &mode);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+ ASSERT_EQ(mode, expected_mode);
+}
+
+TEST(eom_get_output_mode, work_flow_success_2)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_output_mode_e mode;
+
+ _init_test();
+
+ error = eom_get_output_mode(output_id, &mode);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+TEST(eom_get_output_mode, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_mode_e mode;
+
+ _init_test();
+
+ error = eom_get_output_mode(0, &mode);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_get_output_type() */
+
+TEST(eom_get_output_type, work_flow_success_3)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_type_e type = EOM_OUTPUT_TYPE_UNKNOWN;
+ eom_output_type_e expected_type = EOM_OUTPUT_TYPE_VGA;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ output_info.type = expected_type;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+
+ error = eom_get_output_type(output_id, &type);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+ ASSERT_EQ(type, expected_type);
+}
+
+TEST(eom_get_output_type1, work_flow_success_2)
+{
+ eom_output_id output_id = 1;
+ int last_result = EOM_ERROR_NONE;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_output_type_e type;
+
+ _init_test();
+
+ error = eom_get_output_type(output_id, &type);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+TEST(eom_get_output_type2, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_type_e type;
+
+ _init_test();
+
+ error = eom_get_output_type(0, &type);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_set_output_attribute() */
+
+TEST(eom_set_output_attribute, work_flow_success_7)
+{
+ eom_output_id output_id = 9849;
+ eom_error_e error = EOM_ERROR_MESSAGE_OPERATION_FAILURE;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_attribute_e attr = EOM_OUTPUT_ATTRIBUTE_NORMAL;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+
+ error = eom_set_output_attribute(output_id, attr);
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(output_info.attribute, attr);
+}
+
+TEST(eom_set_output_attribute, work_flow_success_6)
+{
+ eom_output_id output_id = 9849;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_MESSAGE_OPERATION_FAILURE;
+ eom_output_attribute_e attr = EOM_OUTPUT_ATTRIBUTE_NORMAL;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+ EOM_WAYLEND_RET_ERROR = 1;
+
+ error = eom_set_output_attribute(output_id, attr);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_attribute, work_flow_success_5)
+{
+ eom_output_id output_id = 9849;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_MESSAGE_SENDING_FAILURE;
+ eom_output_attribute_e attr = EOM_OUTPUT_ATTRIBUTE_NORMAL;
+ eom_output_info output_info;
+ GList list;
+
+ _init_test();
+
+ output_info.id = output_id;
+ list.data = &output_info;
+ list.next = list.prev = NULL;
+ output_info_list = &list;
+ EOM_WAYLEND_ERROR = 1;
+
+ error = eom_set_output_attribute(output_id, attr);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_attribute, work_flow_success_4)
+{
+ eom_output_id output_id = 1;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_NO_SUCH_DEVICE;
+ eom_output_attribute_e attr = EOM_OUTPUT_ATTRIBUTE_NORMAL;
+ int last_result = EOM_ERROR_NONE;
+
+ _init_test();
+
+ error = eom_set_output_attribute(output_id, attr);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+TEST(eom_set_output_attribute, work_flow_success_3)
+{
+ eom_output_id output_id = 1;
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_attribute_e attr = EOM_OUTPUT_ATTRIBUTE_MAX;
+
+ _init_test();
+
+ error = eom_set_output_attribute(output_id, attr);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_attribute, work_flow_success_2)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_attribute_e attr = EOM_OUTPUT_ATTRIBUTE_NONE;
+
+ _init_test();
+
+ error = eom_set_output_attribute(1, attr);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_attribute, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_attribute_e attr;
+
+ _init_test();
+
+ error = eom_set_output_attribute(0, attr);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_unset_attribute_changed_cb() */
+
+TEST(eom_unset_attribute_changed_cb, work_flow_success_3)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_notify_cb_info cb_info1;
+ eom_output_notify_cb_info *cb_info2;
+
+ _init_test();
+
+ cb_info1.attribute_change_func = ut_eom_cb1;
+ cb_info2 = calloc(1, sizeof(eom_output_notify_cb_info));
+ cb_info2->attribute_change_func = ut_eom_cb;
+ cb_info_list = g_list_append(cb_info_list, &cb_info1);
+ cb_info_list = g_list_append(cb_info_list, cb_info2);
+ FREE_TESTED_PTR = cb_info2;
+
+ error = eom_unset_attribute_changed_cb(ut_eom_cb);
+
+ cb_info_list = g_list_remove(cb_info_list, &cb_info1);
+ cb_info_list = g_list_remove(cb_info_list, cb_info2);
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(free_called_for_tested_ptr, 1);
+}
+
+TEST(eom_unset_attribute_changed_cb, work_flow_success_2)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_notify_cb_info cb_info1;
+ eom_output_notify_cb_info cb_info2;
+
+ _init_test();
+
+ cb_info1.attribute_change_func = ut_eom_cb1;
+ cb_info2.attribute_change_func = ut_eom_cb1;
+ cb_info_list = g_list_append(cb_info_list, &cb_info1);
+ cb_info_list = g_list_append(cb_info_list, &cb_info2);
+
+ error = eom_unset_attribute_changed_cb(ut_eom_cb);
+
+ cb_info_list = g_list_remove(cb_info_list, &cb_info1);
+ cb_info_list = g_list_remove(cb_info_list, &cb_info2);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_unset_attribute_changed_cb, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_unset_attribute_changed_cb(ut_eom_cb);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_unset_attribute_changed_cb, null_ptr_fail_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_unset_attribute_changed_cb(NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_set_attribute_changed_cb() */
+
+TEST(eom_set_attribute_changed_cb, work_flow_success_4)
+{
+ eom_error_e error = EOM_ERROR_OUT_OF_MEMORY;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_notify_type_e expected_type = EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED;
+ int user_data = 324;
+ eom_output_notify_cb_info *cb_info;
+ eom_output_notify_cb_info info;
+ GList *l;
+
+ _init_test();
+
+ error = eom_set_attribute_changed_cb(ut_eom_cb, &user_data);
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_TRUE(cb_info_list != NULL);
+ for (l = cb_info_list; l != NULL; l = g_list_next(l)) {
+ cb_info = (eom_output_notify_cb_info *)l->data;
+ if (cb_info)
+ break;
+ }
+ cb_info_list = g_list_remove_all(cb_info_list, cb_info);
+ ASSERT_TRUE(cb_info != NULL);
+ info = *cb_info;
+ free(cb_info);
+ ASSERT_TRUE(info.attribute_change_func == ut_eom_cb);
+ ASSERT_TRUE(info.user_data == &user_data);
+ ASSERT_EQ(info.type, expected_type);
+}
+
+TEST(eom_set_attribute_changed_cb, work_flow_success_3)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_OUT_OF_MEMORY;
+
+ _init_test();
+
+ CALLOC_ERROR = 1;
+
+ error = eom_set_attribute_changed_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_attribute_changed_cb, work_flow_success_2)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ GList list1;
+ eom_output_notify_cb_info cb_info1;
+ GList list;
+ eom_output_notify_cb_info cb_info;
+
+ _init_test();
+
+ cb_info1.attribute_change_func = ut_eom_cb1;
+ list1.data = &cb_info1;
+ cb_info_list = &list1;
+ list1.next = list1.prev = NULL;
+
+ cb_info.attribute_change_func = ut_eom_cb;
+ list.data = &cb_info;
+ list.next = list.prev = NULL;
+ list1.next = &list;
+ list.prev = &list1;
+
+ error = eom_set_attribute_changed_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_attribute_changed_cb, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ GList list;
+ eom_output_notify_cb_info cb_info;
+
+ _init_test();
+
+ cb_info.attribute_change_func = ut_eom_cb;
+ list.data = &cb_info;
+ cb_info_list = &list;
+ list.next = list.prev = NULL;
+
+ error = eom_set_attribute_changed_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_attribute_changed_cb, null_ptr_fail_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_set_attribute_changed_cb(NULL, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_unset_mode_changed_cb() */
+
+TEST(eom_unset_mode_changed_cb, work_flow_success_3)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_notify_cb_info cb_info1;
+ eom_output_notify_cb_info *cb_info2;
+
+ _init_test();
+
+ cb_info1.mode_change_func = ut_eom_cb1;
+ cb_info2 = calloc(1, sizeof(eom_output_notify_cb_info));
+ cb_info2->mode_change_func = ut_eom_cb;
+ cb_info_list = g_list_append(cb_info_list, &cb_info1);
+ cb_info_list = g_list_append(cb_info_list, cb_info2);
+ FREE_TESTED_PTR = cb_info2;
+
+ error = eom_unset_mode_changed_cb(ut_eom_cb);
+
+ cb_info_list = g_list_remove(cb_info_list, &cb_info1);
+ cb_info_list = g_list_remove(cb_info_list, cb_info2);
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(free_called_for_tested_ptr, 1);
+}
+
+TEST(eom_unset_mode_changed_cb, work_flow_success_2)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_notify_cb_info cb_info1;
+ eom_output_notify_cb_info cb_info2;
+
+ _init_test();
+
+ cb_info1.mode_change_func = ut_eom_cb1;
+ cb_info2.mode_change_func = ut_eom_cb1;
+ cb_info_list = g_list_append(cb_info_list, &cb_info1);
+ cb_info_list = g_list_append(cb_info_list, &cb_info2);
+
+ error = eom_unset_mode_changed_cb(ut_eom_cb);
+
+ cb_info_list = g_list_remove(cb_info_list, &cb_info1);
+ cb_info_list = g_list_remove(cb_info_list, &cb_info2);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_unset_mode_changed_cb, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_unset_mode_changed_cb(ut_eom_cb);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_unset_mode_changed_cb, null_ptr_fail_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_unset_mode_changed_cb(NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_set_mode_changed_cb() */
+
+TEST(eom_set_mode_changed_cb, work_flow_success_4)
+{
+ eom_error_e error = EOM_ERROR_OUT_OF_MEMORY;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_notify_type_e expected_type = EOM_OUTPUT_NOTIFY_MODE_CHANGED;
+ int user_data = 324;
+ eom_output_notify_cb_info *cb_info;
+ eom_output_notify_cb_info info;
+ GList *l;
+
+ _init_test();
+
+ error = eom_set_mode_changed_cb(ut_eom_cb, &user_data);
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_TRUE(cb_info_list != NULL);
+ for (l = cb_info_list; l; l = g_list_next(l)) {
+ cb_info = (eom_output_notify_cb_info *)l->data;
+ if (cb_info)
+ break;
+ }
+ cb_info_list = g_list_remove_all(cb_info_list, cb_info);
+ ASSERT_TRUE(cb_info != NULL);
+ info = *cb_info;
+ free(cb_info);
+ ASSERT_TRUE(info.mode_change_func == ut_eom_cb);
+ ASSERT_TRUE(info.user_data == &user_data);
+ ASSERT_EQ(info.type, expected_type);
+}
+
+TEST(eom_set_mode_changed_cb, work_flow_success_3)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_OUT_OF_MEMORY;
+
+ _init_test();
+
+ cb_info_list = NULL;
+ CALLOC_ERROR = 1;
+
+ error = eom_set_mode_changed_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_mode_changed_cb, work_flow_success_2)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ GList list1;
+ eom_output_notify_cb_info cb_info1;
+ GList list;
+ eom_output_notify_cb_info cb_info;
+
+ _init_test();
+
+ cb_info1.mode_change_func = ut_eom_cb1;
+ list1.data = &cb_info1;
+ cb_info_list = &list1;
+ list1.next = list1.prev = NULL;
+
+ cb_info.mode_change_func = ut_eom_cb;
+ list.data = &cb_info;
+ list.next = list.prev = NULL;
+ list1.next = &list;
+ list.prev = &list1;
+
+ error = eom_set_mode_changed_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_mode_changed_cb, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ GList list;
+ eom_output_notify_cb_info cb_info;
+
+ _init_test();
+
+ cb_info.mode_change_func = ut_eom_cb;
+ list.data = &cb_info;
+ cb_info_list = &list;
+ list.next = list.prev = NULL;
+
+ error = eom_set_mode_changed_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_mode_changed_cb, null_ptr_fail_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_set_mode_changed_cb(NULL, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_unset_output_removed_cb() */
+
+TEST(eom_unset_output_removed_cb, work_flow_success_3)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_notify_cb_info cb_info1;
+ eom_output_notify_cb_info *cb_info2;
+
+ _init_test();
+
+ cb_info1.remove_func = ut_eom_cb1;
+ cb_info2 = calloc(1, sizeof(eom_output_notify_cb_info));
+ cb_info2->remove_func = ut_eom_cb;
+ cb_info_list = g_list_append(cb_info_list, &cb_info1);
+ cb_info_list = g_list_append(cb_info_list, cb_info2);
+ FREE_TESTED_PTR = cb_info2;
+
+ error = eom_unset_output_removed_cb(ut_eom_cb);
+
+ cb_info_list = g_list_remove(cb_info_list, &cb_info1);
+ cb_info_list = g_list_remove(cb_info_list, cb_info2);
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(free_called_for_tested_ptr, 1);
+}
+
+TEST(eom_unset_output_removed_cb, work_flow_success_2)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_notify_cb_info cb_info1;
+ eom_output_notify_cb_info cb_info2;
+
+ _init_test();
+
+ cb_info1.remove_func = ut_eom_cb1;
+ cb_info2.remove_func = ut_eom_cb1;
+ cb_info_list = g_list_append(cb_info_list, &cb_info1);
+ cb_info_list = g_list_append(cb_info_list, &cb_info2);
+
+ error = eom_unset_output_removed_cb(ut_eom_cb);
+
+ cb_info_list = g_list_remove(cb_info_list, &cb_info1);
+ cb_info_list = g_list_remove(cb_info_list, &cb_info2);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_unset_output_removed_cb, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_unset_output_removed_cb(ut_eom_cb);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_unset_output_removed_cb, null_ptr_fail_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_unset_output_removed_cb(NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_set_output_removed_cb() */
+
+TEST(eom_set_output_removed_cb, work_flow_success_4)
+{
+ eom_error_e error = EOM_ERROR_OUT_OF_MEMORY;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_notify_type_e expected_type = EOM_OUTPUT_NOTIFY_REMOVE;
+ int user_data = 324;
+ eom_output_notify_cb_info *cb_info;
+ eom_output_notify_cb_info info;
+ GList *l;
+
+ _init_test();
+
+ error = eom_set_output_removed_cb(ut_eom_cb, &user_data);
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_TRUE(cb_info_list != NULL);
+ for (l = cb_info_list; l; l = g_list_next(l)) {
+ cb_info = (eom_output_notify_cb_info *)l->data;
+ if (cb_info)
+ break;
+ }
+ cb_info_list = g_list_remove_all(cb_info_list, cb_info);
+ ASSERT_TRUE(cb_info != NULL);
+ info = *cb_info;
+ free(cb_info);
+ ASSERT_TRUE(info.remove_func == ut_eom_cb);
+ ASSERT_TRUE(info.user_data == &user_data);
+ ASSERT_EQ(info.type, expected_type);
+}
+
+TEST(eom_set_output_removed_cb, work_flow_success_3)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_OUT_OF_MEMORY;
+
+ _init_test();
+
+ CALLOC_ERROR = 1;
+
+ error = eom_set_output_removed_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_removed_cb, work_flow_success_2)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ GList list1;
+ eom_output_notify_cb_info cb_info1;
+ GList list;
+ eom_output_notify_cb_info cb_info;
+
+ _init_test();
+
+ cb_info1.remove_func = ut_eom_cb1;
+ list1.data = &cb_info1;
+ cb_info_list = &list1;
+ list1.next = list1.prev = NULL;
+
+ cb_info.remove_func = ut_eom_cb;
+ list.data = &cb_info;
+ list.next = list.prev = NULL;
+ list1.next = &list;
+ list.prev = &list1;
+
+ error = eom_set_output_removed_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_removed_cb, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ GList list;
+ eom_output_notify_cb_info cb_info;
+
+ _init_test();
+
+ cb_info.remove_func = ut_eom_cb;
+ list.data = &cb_info;
+ cb_info_list = &list;
+ list.next = list.prev = NULL;
+
+ error = eom_set_output_removed_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_removed_cb, null_ptr_fail_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_set_output_removed_cb(NULL, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_unset_output_added_cb() */
+
+TEST(eom_unset_output_added_cb, work_flow_success_3)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_notify_cb_info cb_info1;
+ eom_output_notify_cb_info *cb_info2;
+
+ _init_test();
+
+ cb_info1.add_func = ut_eom_cb1;
+ cb_info2 = calloc(1, sizeof(eom_output_notify_cb_info));
+ cb_info2->add_func = ut_eom_cb;
+ cb_info_list = g_list_append(cb_info_list, &cb_info1);
+ cb_info_list = g_list_append(cb_info_list, cb_info2);
+ FREE_TESTED_PTR = cb_info2;
+
+ error = eom_unset_output_added_cb(ut_eom_cb);
+
+ cb_info_list = g_list_remove(cb_info_list, &cb_info1);
+ cb_info_list = g_list_remove(cb_info_list, cb_info2);
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_EQ(free_called_for_tested_ptr, 1);
+}
+
+TEST(eom_unset_output_added_cb, work_flow_success_2)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_notify_cb_info cb_info1;
+ eom_output_notify_cb_info cb_info2;
+
+ _init_test();
+
+ cb_info1.add_func = ut_eom_cb1;
+ cb_info2.add_func = ut_eom_cb1;
+ cb_info_list = g_list_append(cb_info_list, &cb_info1);
+ cb_info_list = g_list_append(cb_info_list, &cb_info2);
+
+ error = eom_unset_output_added_cb(ut_eom_cb);
+
+ cb_info_list = g_list_remove(cb_info_list, &cb_info1);
+ cb_info_list = g_list_remove(cb_info_list, &cb_info2);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_unset_output_added_cb, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_unset_output_added_cb(ut_eom_cb);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_unset_output_added_cb, null_ptr_fail_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_unset_output_added_cb(NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_set_output_added_cb() */
+
+TEST(eom_set_output_added_cb, work_flow_success_4)
+{
+ eom_error_e error = EOM_ERROR_OUT_OF_MEMORY;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ eom_output_notify_type_e expected_type = EOM_OUTPUT_NOTIFY_ADD;
+ int user_data = 324;
+ eom_output_notify_cb_info *cb_info;
+ eom_output_notify_cb_info info;
+ GList *l;
+
+ _init_test();
+
+ error = eom_set_output_added_cb(ut_eom_cb, &user_data);
+
+ ASSERT_EQ(error, expected_error);
+ ASSERT_TRUE(cb_info_list != NULL);
+ for (l = cb_info_list; l; l = g_list_next(l)) {
+ cb_info = (eom_output_notify_cb_info *)l->data;
+ if (cb_info)
+ break;
+ }
+ cb_info_list = g_list_remove_all(cb_info_list, cb_info);
+ ASSERT_TRUE(cb_info != NULL);
+ info = *cb_info;
+ free(cb_info);
+ ASSERT_TRUE(info.add_func == ut_eom_cb);
+ ASSERT_TRUE(info.user_data == &user_data);
+ ASSERT_EQ(info.type, expected_type);
+}
+
+TEST(eom_set_output_added_cb, work_flow_success_3)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_OUT_OF_MEMORY;
+
+ _init_test();
+
+ CALLOC_ERROR = 1;
+
+ error = eom_set_output_added_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_added_cb, work_flow_success_2)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ GList list1;
+ eom_output_notify_cb_info cb_info1;
+ GList list;
+ eom_output_notify_cb_info cb_info;
+
+ _init_test();
+
+ cb_info1.add_func = ut_eom_cb1;
+ list1.data = &cb_info1;
+ cb_info_list = &list1;
+ list1.next = list1.prev = NULL;
+
+ cb_info.add_func = ut_eom_cb;
+ list.data = &cb_info;
+ list.next = list.prev = NULL;
+ list1.next = &list;
+ list.prev = &list1;
+
+ error = eom_set_output_added_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_added_cb, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+ GList list;
+ eom_output_notify_cb_info cb_info;
+
+ _init_test();
+
+ cb_info.add_func = ut_eom_cb;
+ list.data = &cb_info;
+ cb_info_list = &list;
+ list.next = list.prev = NULL;
+
+ error = eom_set_output_added_cb(ut_eom_cb, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_set_output_added_cb, null_ptr_fail_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_INVALID_PARAMETER;
+
+ _init_test();
+
+ error = eom_set_output_added_cb(NULL, NULL);
+
+ ASSERT_EQ(error, expected_error);
+}
+
+/* eom_get_eom_output_ids() */
+
+TEST(eom_get_eom_output_ids, work_flow_success_5)
+{
+ int count = 0;
+ int expected_error = EOM_ERROR_NONE;
+ eom_output_id *not_expected = NULL;
+ eom_output_id *actual;
+ int last_result = EOM_ERROR_NONE;
+
+ _init_test();
+
+ actual = eom_get_eom_output_ids(&count);
+
+ last_result = get_last_result();
+
+ ASSERT_TRUE(actual != not_expected);
+ free(actual);
+ ASSERT_EQ(last_result, expected_error);
+ ASSERT_TRUE(output_info_list != NULL);
+ while (output_info_list) {
+ eom_output_info *output_info = (eom_output_info *)output_info_list->data;
+ output_info_list = g_list_remove(output_info_list, output_info);
+ free(output_info);
+
+ }
+}
+
+TEST(eom_get_eom_output_ids, work_flow_success_4)
+{
+ int count = 0;
+ int expected_error = EOM_ERROR_OUT_OF_MEMORY;
+ eom_output_id *expected = NULL;
+ eom_output_id *actual;
+ int last_result = EOM_ERROR_NONE;
+
+ _init_test();
+
+ CALLOC_ERROR = 1;
+
+ actual = eom_get_eom_output_ids(&count);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(actual, expected);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+TEST(eom_get_eom_output_ids, work_flow_success_3)
+{
+ int count = 0;
+ int expected_error = EOM_ERROR_NONE;
+ eom_output_id *expected = NULL;
+ eom_output_id *actual;
+ int last_result = EOM_ERROR_NONE;
+
+ _init_test();
+
+ EOM_WAYLEND_RET_ERROR = 1;
+
+ actual = eom_get_eom_output_ids(&count);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(actual, expected);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+TEST(eom_get_eom_output_ids, work_flow_success_2)
+{
+ int count = 0;
+ int expected_error = EOM_ERROR_NONE;
+ eom_output_id *expected = NULL;
+ eom_output_id *actual;
+ int last_result = EOM_ERROR_NONE;
+
+ _init_test();
+
+ EOM_WAYLEND_ERROR = 1;
+
+ actual = eom_get_eom_output_ids(&count);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(actual, expected);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+TEST(eom_get_eom_output_ids, work_flow_success_1)
+{
+ eom_output_id *expected = NULL;
+ int expected_error = EOM_ERROR_INVALID_PARAMETER;
+ eom_output_id *actual;
+ int last_result = EOM_ERROR_NONE;
+
+ _init_test();
+
+ actual = eom_get_eom_output_ids(NULL);
+
+ last_result = get_last_result();
+
+ ASSERT_EQ(actual, expected);
+ ASSERT_EQ(last_result, expected_error);
+}
+
+/* eom_deinit() */
+
+TEST(eom_deinit, work_flow_success_2)
+{
+ GList *expected_list = NULL;
+ GList list;
+
+ _init_test();
+
+ list.next = list.prev = list.data = NULL;
+ output_info_list = &list;
+
+ eom_output_info *data1 = calloc(1, sizeof(eom_output_info));
+ data1->width = 1;
+ eom_output_info *data2 = calloc(1, sizeof(eom_output_info));
+ data2->width = 2;
+ eom_output_info *data3 = calloc(1, sizeof(eom_output_info));
+ data3->width = 3;
+ output_info_list = g_list_append(output_info_list, data1);
+ output_info_list = g_list_append(output_info_list, data2);
+ output_info_list = g_list_append(output_info_list, data3);
+
+ eom_deinit();
+
+ ASSERT_GE(free_call_count, 3);
+ ASSERT_TRUE(output_info_list == expected_list);
+}
+
+TEST(eom_deinit, work_flow_success_1)
+{
+ GList *expected_list = NULL;
+
+ GList list;
+
+ _init_test();
+
+ list.next = list.prev = list.data = NULL;
+ output_info_list = &list;
+
+ eom_output_info *data = calloc(1, sizeof(eom_output_info));
+ output_info_list = g_list_append(output_info_list, data);
+
+ eom_deinit();
+
+ ASSERT_TRUE(output_info_list == expected_list);
+ ASSERT_TRUE(FREE_PTR == data);
+}
+
+/* eom_init() */
+
+TEST(eom_init, work_flow_success_2)
+{
+ eom_error_e error = EOM_ERROR_INVALID_PARAMETER;
+ eom_error_e expected_error = EOM_ERROR_NONE;
+
+ _init_test();
+
+ error = eom_init();
+
+ ASSERT_EQ(error, expected_error);
+}
+
+TEST(eom_init, work_flow_success_1)
+{
+ eom_error_e error = EOM_ERROR_NONE;
+ eom_error_e expected_error = EOM_ERROR_CONNECTION_FAILURE;
+
+ _init_test();
+
+ EOM_WAYLAND_CLIENT_INIT_ERROR = 1;
+
+ error = eom_init();
+
+ ASSERT_EQ(error, expected_error);
+}