return;
}
- ret = mc_server_set_playlist_item_info(g_mc_server, g_mc_test_playlist_name, "3");
+ ret = mc_server_set_playlist_item_info(g_mc_server, g_mc_test_playlist_name, g_mc_test_playlist_index);
if ( ret != MEDIA_CONTROLLER_ERROR_NONE) {
FPRINTF("Startup error at %s:%d\\n", __FILE__, __LINE__);
FPRINTF(" mc_server_set_playlist_item_index failed (code: %d)\\n", ret);
int ret = MEDIA_CONTROLLER_ERROR_NONE;
- ret = mc_server_set_playlist_item_index(g_mc_server, "3");
+ ret = mc_server_set_playlist_item_index(g_mc_server, g_mc_test_playlist_index);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
return 0;
int ret = MEDIA_CONTROLLER_ERROR_NONE;
- ret = mc_server_set_playlist_item_index(NULL, "3");
+ ret = mc_server_set_playlist_item_index(NULL, g_mc_test_playlist_index);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER);
ret = mc_server_set_playlist_item_index(g_mc_server, NULL);
int ret = MEDIA_CONTROLLER_ERROR_NONE;
- ret = mc_server_set_playlist_item_info(g_mc_server, g_mc_test_playlist_name, "3");
+ ret = mc_server_set_playlist_item_info(g_mc_server, g_mc_test_playlist_name, g_mc_test_playlist_index);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
return 0;
int ret = MEDIA_CONTROLLER_ERROR_NONE;
- ret = mc_server_set_playlist_item_info(NULL, g_mc_test_playlist_name, "3");
+ ret = mc_server_set_playlist_item_info(NULL, g_mc_test_playlist_name, g_mc_test_playlist_index);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER);
- ret = mc_server_set_playlist_item_info(g_mc_server, NULL, "3");
+ ret = mc_server_set_playlist_item_info(g_mc_server, NULL, g_mc_test_playlist_index);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER);
ret = mc_server_set_playlist_item_info(g_mc_server, g_mc_test_playlist_name, NULL);
ret = mc_client_get_playlist_item_index(playback_info, &index);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- assert_eq(strcmp(index, "3"), 0);
+ assert_eq(strcmp(index, g_mc_test_playlist_index), 0);
if (index != NULL)
free(index);
ret = mc_client_get_playlist_item_info(playback_info, &playlist_name, &index);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
assert_eq(strcmp(playlist_name, g_mc_test_playlist_name), 0);
- assert_eq(strcmp(index, "3"), 0);
+ assert_eq(strcmp(index, g_mc_test_playlist_index), 0);
if (index != NULL)
free(index);
mc_metadata_h metadata = NULL;
char *value = NULL;
bool check_val = FALSE;
+ int i = 0;
ret = mc_client_get_latest_server_info(g_mc_client, &g_mc_server_name, &g_mc_server_state);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
ret = mc_client_get_server_metadata(g_mc_client, g_mc_server_name, &metadata);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- ret = mc_metadata_get(metadata, MC_META_MEDIA_TITLE, &value);
- assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
+ for (i = MC_META_MEDIA_TITLE; i <= MC_META_MEDIA_PICTURE; i++) {
+ ret = mc_metadata_get(metadata, i, &value);
+ assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
- if (value != NULL) {
- if (strcmp(value, g_mc_test_metadata[0]) == 0)
- check_val = TRUE;
+ if (value != NULL) {
+ if (strcmp(value, g_mc_test_metadata[i]) == 0)
+ check_val = TRUE;
- free(value);
- }
+ free(value);
+ }
- assert_eq(check_val, TRUE);
+ assert_eq(check_val, TRUE);
+ }
ret = mc_client_destroy_metadata(metadata);
assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);