#include "tct_common.h"
#include "utc-media-controller-common.h"
-#define WAIT_CALLBACK_RESULT wait_for_async()
-
-//& set: MediaController
+//& set: MediaControllerClient
static mc_server_h g_mc_server = NULL;
static mc_client_h g_mc_client = NULL;
static char *g_mc_server_name = NULL;
ret = mc_server_destroy(g_mc_server);
g_mc_server = NULL;
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = _mc_register_metadata(g_mc_server);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_client_send_custom_cmd(g_mc_client, g_mc_server_name, g_mc_test_cmd, NULL, &g_request_id);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
assert_eq(g_mc_custom_data.result, TRUE);
assert_eq(strcmp(g_mc_custom_data.name, g_mc_test_appname), 0);
ret = mc_server_send_cmd_reply(g_mc_server, g_mc_custom_data.name, g_mc_custom_data.request_id, g_mc_test_result_code, NULL);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
assert_eq(g_mc_reply_data.result, TRUE);
assert_eq(strcmp(g_mc_reply_data.name, g_mc_test_appname), 0);
ret = mc_client_send_playback_action_cmd(g_mc_client, g_mc_server_name, playback_action, &g_request_id);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_client_send_playback_position_cmd(g_mc_client, g_mc_server_name, g_mc_test_playback_position, &g_request_id);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_client_send_shuffle_mode_cmd(g_mc_client, g_mc_server_name, g_mc_test_shuffle_mode, &g_request_id);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_client_send_repeat_mode_cmd(g_mc_client, g_mc_server_name, g_mc_test_repeat_mode, &g_request_id);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_client_send_playlist_cmd(g_mc_client, g_mc_server_name, g_mc_test_playlist_name, g_mc_test_playlist_index, g_mc_test_playback_action, g_mc_test_playback_position, &g_request_id);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_client_send_custom_cmd(g_mc_client, g_mc_server_name, g_mc_test_cmd, NULL, NULL);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_client_send_search_cmd(g_mc_client, g_mc_server_name, g_mc_search, NULL);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
/* check the search result */
assert_neq(get_search, NULL);
ret = mc_client_send_subtitles_cmd(g_mc_client, g_mc_server_name, true, NULL);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_client_send_360_mode_cmd(g_mc_client, g_mc_server_name, true, NULL);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_client_send_display_mode_cmd(g_mc_client, g_mc_server_name, MC_DISPLAY_MODE_FULL_SCREEN, NULL);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_client_send_display_rotation_cmd(g_mc_client, g_mc_server_name, MC_DISPLAY_ROTATION_270, NULL);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
for (idx = 0; idx < g_mc_test_result_codes_cnt; idx++) {
ret = mc_server_send_custom_event(g_mc_server, g_mc_client_name, g_mc_test_event, NULL, &g_request_id);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
assert_eq(g_mc_custom_data.result, TRUE);
assert_eq(strcmp(g_mc_custom_data.name, g_mc_test_appname), 0);
ret = mc_client_send_event_reply(g_mc_client, g_mc_custom_data.name, g_mc_custom_data.request_id, g_mc_test_result_codes[idx], NULL);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
assert_eq(g_mc_reply_data.result, TRUE);
assert_eq(g_mc_reply_data.result_code, g_mc_test_result_codes[idx]);
#define TIMEOUT_SECONDS 5000
-//& set: MediaController-Common
+//& set: MediaControllerCommon
//Add helper function declarations here
}
}
-gboolean wait_for_async()
+gboolean wait_for_async(void)
{
int timeout_id = 0;
g_mc_mainloop = g_main_loop_new(NULL, FALSE);
#define G_META_W 320
#define G_META_H 240
+
//& set: MediaControllerCommon
//Add global variables here
//Add helper function declarations here
-gboolean wait_for_async();
+gboolean wait_for_async(void);
gboolean _mc_get_display_mode_ability(unsigned int supported_modes);
gboolean _mc_get_display_rotation_ability(unsigned int supported_rotations);
void _mc_release_tc_user_data(tc_user_data *user_data);
#include "tct_common.h"
#include "utc-media-controller-common.h"
-#define WAIT_CALLBACK_RESULT wait_for_async()
-
+//& set: MediaControllerServer
static mc_server_h g_mc_server = NULL;
static mc_client_h g_mc_client = NULL;
static char *g_mc_server_name = NULL;
ret = mc_server_update_playback_ability(g_mc_server);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_server_set_shuffle_ability(g_mc_server, g_mc_test_ability);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_server_set_repeat_ability(g_mc_server, g_mc_test_ability);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
for (i = 0; i <= MC_ABILITY_SEARCH; i++) {
ret = mc_server_set_ability_support(g_mc_server, i, g_mc_test_ability);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
}
return 0;
ret = mc_server_update_playback_info(g_mc_server);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = _mc_register_metadata(g_mc_server);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_server_update_shuffle_mode(g_mc_server, g_mc_test_shuffle_mode);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_server_update_repeat_mode(g_mc_server, g_mc_test_repeat_mode);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_server_update_subtitles_enabled(g_mc_server, true);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_server_update_360_mode_enabled(g_mc_server, true);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;;
}
ret = mc_server_update_display_mode(g_mc_server, MC_DISPLAY_MODE_FULL_SCREEN);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
}
ret = mc_server_update_display_rotation(g_mc_server, MC_DISPLAY_ROTATION_270);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
return 0;
for (idx = 0; idx < g_mc_test_result_codes_cnt; idx++) {
ret = mc_client_send_custom_cmd(g_mc_client, g_mc_server_name, g_mc_test_cmd, NULL, &g_request_id);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
assert_eq(g_mc_custom_data.result, TRUE);
assert_eq(strcmp(g_mc_custom_data.name, g_mc_test_appname), 0);
ret = mc_server_send_cmd_reply(g_mc_server, g_mc_custom_data.name, g_mc_custom_data.request_id, g_mc_test_result_codes[idx], NULL);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
assert_eq(g_mc_reply_data.result, TRUE);
assert_eq(g_mc_reply_data.result_code, g_mc_test_result_codes[idx]);
ret = mc_server_create_playlist(g_mc_server, g_mc_test_playlist_name, &playlist);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
+ ret = mc_server_update_playlist_done(g_mc_server, playlist);
+ assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
+
ret = mc_server_add_item_to_playlist(g_mc_server, playlist, g_mc_test_playlist_idx, MC_META_MEDIA_TITLE, g_mc_test_playlist_metadata[0]);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
ret = mc_server_add_item_to_playlist(g_mc_server, playlist, g_mc_test_playlist_idx, MC_META_MEDIA_ARTIST, g_mc_test_playlist_metadata[1]);
ret = mc_server_update_playlist_done(g_mc_server, playlist);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
ret = mc_playlist_destroy(playlist);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
ret = mc_server_send_custom_event(g_mc_server, g_mc_client_name, g_mc_test_event, NULL, NULL);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(WAIT_CALLBACK_RESULT, TRUE);
+ assert_eq(wait_for_async(), TRUE);
ret = mc_client_unset_custom_event_received_cb(g_mc_client);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
#include "tct_common.h"
#include "utc-media-controller-common.h"
-#define WAIT_CALLBACK_RESULT wait_for_async()
-
//& set: MediaController
static mc_server_h g_mc_server = NULL;
*/
void utc_mc_search_startup(void)
{
- mc_error_e ret = MEDIA_CONTROLLER_ERROR_NONE;
-
// do nothing...
return;