}
mmi_ipc_shutdown();
+
+ GList *iter = NULL;
+ result_cb_s *data = NULL;
+
+ if (g_list_length(mmi_h->result_cb_list) > 0) {
+ iter = g_list_first(mmi_h->result_cb_list);
+ while (iter != NULL) {
+ data = iter->data;
+ if (data != NULL) {
+ data->input_event_type = 0;
+ data->result_callback = NULL;
+ free(data);
+ data = NULL;
+
+ GList *temp = iter;
+ iter = g_list_next(iter);
+ mmi_h->result_cb_list = g_list_remove_link(mmi_h->result_cb_list, temp);
+ }
+ }
+ }
+
free(mmi_h);
mmi_h = NULL;
{
}
+void voice_recognition_callback(void *user_data, int input_event_type, const char *result_out)
+{
+}
+
TEST_F(MMIMainTest, MMIClientSetResultCbSuccess)
{
int res = mmi_init();
EXPECT_EQ(res, MMI_ERROR_NONE);
mmi_handle mmi_client = mmi_client_get();
+
GList* iter = NULL;
result_cb_s *data = NULL;
mmi_input_event_type_e input_event_type = MMI_VOICE_TOUCH;
EXPECT_EQ(res, MMI_ERROR_NONE);
+
res = mmi_set_result_cb(input_event_type, voice_touch_callback, NULL);
EXPECT_EQ(res, MMI_ERROR_NONE);
mmi_shutdown();
}
+
+TEST_F(MMIMainTest, MMIClientDestroyRemoveGList)
+{
+ int res = mmi_init();
+ mmi_input_event_type_e input_event_type = MMI_VOICE_TOUCH;
+
+ EXPECT_EQ(res, MMI_ERROR_NONE);
+
+ res = mmi_set_result_cb(input_event_type, voice_touch_callback, NULL);
+ EXPECT_EQ(res, MMI_ERROR_NONE);
+
+ res = mmi_set_result_cb(MMI_VOICE_RECOGNITION, voice_recognition_callback, NULL);
+ EXPECT_EQ(res, MMI_ERROR_NONE);
+
+ mmi_client_destroy();
+}