Merge "[UTC][capi-media-controller][ACR-1300][Add utc test-cases]" into tizen
authorAmritanshu Pandia <a.pandia1@samsung.com>
Tue, 18 Sep 2018 12:26:36 +0000 (12:26 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 18 Sep 2018 12:26:36 +0000 (12:26 +0000)
1  2 
src/utc/media-controller/tct-media-controller-core_mobile.h
src/utc/media-controller/tct-media-controller-core_tizeniot.h
src/utc/media-controller/tct-media-controller-core_wearable.h
src/utc/media-controller/utc-media-controller.c

index 890bed97cf6af2d27ae50215adca440f5a9a44fd,e1fe4f53c7988bb860b85f9ff463910e0054b721..5cfb72302267f1b357f564f4e75f6073fa4fd9e6
@@@ -4274,74 -3576,11 +4314,143 @@@ int utc_mc_client_get_age_rating_n(void
  }
  
  /**
 - * @testcase          utc_mc_client_destroy_playback_p
 - * @since_tizen               2.4
 - * @description               Positive test case of mc_client_destroy_playback()
 + * @testcase          utc_mc_client_get_playlist_item_index_p
 + * @since_tizen               4.0
 + * @description               Positive test case of mc_client_get_playlist_item_index()
   */
 -int utc_mc_client_destroy_playback_p(void)
 +int utc_mc_client_get_playlist_item_index_p(void)
 +{
 +      assert_eq(startup_ret, MEDIA_CONTROLLER_ERROR_NONE);
 +
 +      int ret = MEDIA_CONTROLLER_ERROR_NONE;
 +      mc_playback_h playback_info = NULL;
 +      char * index = 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_playback_info(g_mc_client, g_mc_server_name, &playback_info);
 +      assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
 +
 +      ret = mc_client_get_playlist_item_index(playback_info, &index);
 +      assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
 +      assert_eq(strcmp(index, "3"), 0);
 +
 +      if (index != NULL)
 +              free(index);
 +
 +      ret = mc_client_destroy_playback(playback_info);
 +      assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
 +
 +      return 0;
 +}
 +
 +/**
 + * @testcase          utc_mc_client_get_playlist_item_index_n
 + * @since_tizen               4.0
 + * @description               Negative test case of mc_client_get_playlist_item_index()
 + */
 +int utc_mc_client_get_playlist_item_index_n(void)
 +{
 +    assert_eq(startup_ret, MEDIA_CONTROLLER_ERROR_NONE);
 +
 +    int ret = MEDIA_CONTROLLER_ERROR_NONE;
 +    mc_playback_h playback_info = NULL;
 +    char * index = 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_playback_info(g_mc_client, g_mc_server_name, &playback_info);
 +    assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
 +
 +    ret = mc_client_get_playlist_item_index(NULL, &index);
 +    assert_eq(ret, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER);
 +
 +    ret = mc_client_get_playlist_item_index(playback_info, NULL);
 +    assert_eq(ret, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER);
 +
 +    ret = mc_client_destroy_playback(playback_info);
 +    assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
 +
 +    return 0;
 +}
 +
++/**
++ * @testcase          utc_mc_client_get_playlist_item_info_p
++ * @since_tizen               5.0
++ * @description               Positive test case of mc_client_get_playlist_item_info()
++ */
++int utc_mc_client_get_playlist_item_info_p(void)
++{
++      assert_eq(startup_ret, MEDIA_CONTROLLER_ERROR_NONE);
++
++      int ret = MEDIA_CONTROLLER_ERROR_NONE;
++      mc_playback_h playback_info = NULL;
++      char *playlist_name = NULL;
++      char *index = 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_playback_info(g_mc_client, g_mc_server_name, &playback_info);
++      assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
++
++      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_playlist_name), 0);
++      assert_eq(strcmp(index, "3"), 0);
++
++      if (index != NULL)
++              free(index);
++
++      ret = mc_client_destroy_playback(playback_info);
++      assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
++
++      return 0;
++}
++
++/**
++ * @testcase          utc_mc_client_get_playlist_item_info_n
++ * @since_tizen               5.0
++ * @description               Negative test case of mc_client_get_playlist_item_info()
++ */
++int utc_mc_client_get_playlist_item_info_n(void)
++{
++    assert_eq(startup_ret, MEDIA_CONTROLLER_ERROR_NONE);
++
++    int ret = MEDIA_CONTROLLER_ERROR_NONE;
++    mc_playback_h playback_info = NULL;
++      char *playlist_name = NULL;
++      char *index = 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_playback_info(g_mc_client, g_mc_server_name, &playback_info);
++    assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
++
++    ret = mc_client_get_playlist_item_info(NULL, &playlist_name, &index);
++    assert_eq(ret, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER);
++
++    ret = mc_client_get_playlist_item_info(playback_info, NULL, &index);
++    assert_eq(ret, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER);
++
++    ret = mc_client_get_playlist_item_info(playback_info, &playlist_name, NULL);
++    assert_eq(ret, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER);
++
++    ret = mc_client_destroy_playback(playback_info);
++    assert_eq(ret, MEDIA_CONTROLLER_ERROR_NONE);
++
++    return 0;
++}
++
 +/**
 + * @testcase          utc_mc_client_destroy_playback_p
 + * @since_tizen               2.4
 + * @description               Positive test case of mc_client_destroy_playback()
 + */
 +int utc_mc_client_destroy_playback_p(void)
  {
      assert_eq(startup_ret, MEDIA_CONTROLLER_ERROR_NONE);