2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include <media_content.h>
22 static void startup(void);
23 static void cleanup(void);
25 void (*tet_startup)(void) = startup;
26 void (*tet_cleanup)(void) = cleanup;
28 static void utc_audio_meta_destroy_n(void);
29 static void utc_audio_meta_destroy_p(void);
30 static void utc_audio_meta_clone_n(void);
31 static void utc_audio_meta_clone_p(void);
32 static void utc_audio_meta_get_media_id_n(void);
33 static void utc_audio_meta_get_media_id_p(void);
34 static void utc_audio_meta_get_title_n(void);
35 static void utc_audio_meta_get_title_p(void);
36 static void utc_audio_meta_get_album_n(void);
37 static void utc_audio_meta_get_album_p(void);
38 static void utc_audio_meta_get_artist_n(void);
39 static void utc_audio_meta_get_artist_p(void);
40 static void utc_audio_meta_get_genre_n(void);
41 static void utc_audio_meta_get_genre_p(void);
42 static void utc_audio_meta_get_composer_n(void);
43 static void utc_audio_meta_get_composer_p(void);
44 static void utc_audio_meta_get_year_n(void);
45 static void utc_audio_meta_get_year_p(void);
46 static void utc_audio_meta_get_recorded_date_n(void);
47 static void utc_audio_meta_get_recorded_date_p(void);
48 static void utc_audio_meta_get_copyright_n(void);
49 static void utc_audio_meta_get_copyright_p(void);
50 static void utc_audio_meta_get_track_num_n(void);
51 static void utc_audio_meta_get_track_num_p(void);
52 static void utc_audio_meta_get_bit_rate_n(void);
53 static void utc_audio_meta_get_bit_rate_p(void);
54 static void utc_audio_meta_get_sample_rate_n(void);
55 static void utc_audio_meta_get_sample_rate_p(void);
56 static void utc_audio_meta_get_channel_n(void);
57 static void utc_audio_meta_get_channel_p(void);
58 static void utc_audio_meta_get_duration_n(void);
59 static void utc_audio_meta_get_duration_p(void);
60 static void utc_audio_meta_get_played_count_n(void);
61 static void utc_audio_meta_get_played_count_p(void);
62 static void utc_audio_meta_get_played_time_n(void);
63 static void utc_audio_meta_get_played_time_p(void);
64 static void utc_audio_meta_get_played_position_n(void);
65 static void utc_audio_meta_get_played_position_p(void);
66 static void utc_audio_meta_update_to_db_n(void);
67 static void utc_audio_meta_update_to_db_p(void);
68 static void utc_audio_meta_set_played_count_n(void);
69 static void utc_audio_meta_set_played_count_p(void);
70 static void utc_audio_meta_set_played_time_n(void);
71 static void utc_audio_meta_set_played_time_p(void);
72 static void utc_audio_meta_set_played_position_n(void);
73 static void utc_audio_meta_set_played_position_p(void);
76 struct tet_testlist tet_testlist[] = {
77 { utc_audio_meta_destroy_n, 5 },
78 { utc_audio_meta_destroy_p, 5 },
79 { utc_audio_meta_clone_n, 4 },
80 { utc_audio_meta_clone_p, 4 },
81 { utc_audio_meta_get_media_id_n, 1 },
82 { utc_audio_meta_get_media_id_p, 1 },
83 { utc_audio_meta_get_title_n, 1 },
84 { utc_audio_meta_get_title_p, 1 },
85 { utc_audio_meta_get_album_n, 1 },
86 { utc_audio_meta_get_album_p, 1 },
87 { utc_audio_meta_get_artist_n, 1 },
88 { utc_audio_meta_get_artist_p, 1 },
89 { utc_audio_meta_get_genre_n, 1 },
90 { utc_audio_meta_get_genre_p, 1 },
91 { utc_audio_meta_get_composer_n, 1 },
92 { utc_audio_meta_get_composer_p, 1 },
93 { utc_audio_meta_get_year_n, 1 },
94 { utc_audio_meta_get_year_p, 1 },
95 { utc_audio_meta_get_recorded_date_n, 1 },
96 { utc_audio_meta_get_recorded_date_p, 1 },
97 { utc_audio_meta_get_copyright_n, 1 },
98 { utc_audio_meta_get_copyright_p, 1 },
99 { utc_audio_meta_get_track_num_n, 1 },
100 { utc_audio_meta_get_track_num_p, 1 },
101 { utc_audio_meta_get_bit_rate_n, 1 },
102 { utc_audio_meta_get_bit_rate_p, 1 },
103 { utc_audio_meta_get_sample_rate_n, 1 },
104 { utc_audio_meta_get_sample_rate_p, 1 },
105 { utc_audio_meta_get_channel_n, 1 },
106 { utc_audio_meta_get_channel_p, 1 },
107 { utc_audio_meta_get_duration_n, 1 },
108 { utc_audio_meta_get_duration_p, 1 },
109 { utc_audio_meta_get_played_count_n, 1 },
110 { utc_audio_meta_get_played_count_p, 1 },
111 { utc_audio_meta_get_played_time_n, 1 },
112 { utc_audio_meta_get_played_time_p, 1 },
113 { utc_audio_meta_get_played_position_n, 1 },
114 { utc_audio_meta_get_played_position_p, 1 },
115 { utc_audio_meta_set_played_count_n, 2 },
116 { utc_audio_meta_set_played_count_p, 2 },
117 { utc_audio_meta_set_played_time_n, 2 },
118 { utc_audio_meta_set_played_time_p, 2 },
119 { utc_audio_meta_set_played_position_n, 2 },
120 { utc_audio_meta_set_played_position_p, 2 },
121 { utc_audio_meta_update_to_db_n, 3 },
122 { utc_audio_meta_update_to_db_p, 3 },
126 static audio_meta_h g_audio;
127 static audio_meta_h g_audio_dst;
128 static char *g_media_id = NULL;
130 bool media_item_cb(media_info_h media, void *user_data)
132 int ret = MEDIA_CONTENT_ERROR_NONE;
134 ret = media_info_get_media_id(media, &g_media_id);
135 if((ret != MEDIA_CONTENT_ERROR_NONE) || (g_media_id == NULL))
137 tet_printf("\n get media_id failed");
141 ret = media_info_get_audio(media, &g_audio);
142 if((ret != MEDIA_CONTENT_ERROR_NONE) || (g_audio == NULL))
144 tet_printf("\n get audio_meta failed");
151 static void startup(void)
154 tet_printf("\n TC start");
159 int ret = media_content_connect();
160 if(ret != MEDIA_CONTENT_ERROR_NONE)
162 tet_printf("\n database connection is failed");
167 tet_printf("\n database connection is success");
170 char *condition = "MEDIA_TYPE=3"; //Music
172 media_filter_create(&filter);
173 media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT);
174 media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_TITLE, MEDIA_CONTENT_COLLATE_DEFAULT);
177 tet_printf("\n filter create failed");
181 ret = media_info_foreach_media_from_db(filter, media_item_cb, NULL);
182 if(ret != MEDIA_CONTENT_ERROR_NONE)
184 tet_printf("\n get media_info failed");
188 media_filter_destroy(filter);
190 tet_printf("\n TC start END");
193 static void cleanup(void)
196 tet_printf("\n TC end");
198 if(g_media_id != NULL)
202 audio_meta_destroy(g_audio);
204 int ret = media_content_disconnect();
206 if(ret != MEDIA_CONTENT_ERROR_NONE)
207 tet_printf("\n database disconnection is failed");
209 tet_printf("\n database disconnection is success");
213 * @brief Negative test case of content_imageinfo_destroy()
215 static void utc_audio_meta_destroy_n(void)
217 int ret = MEDIA_CONTENT_ERROR_NONE;
219 ret = audio_meta_destroy(NULL);
221 dts_check_eq("utc_audio_meta_destroy_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
225 * @brief Positive test case of content_imageinfo_destroy()
227 static void utc_audio_meta_destroy_p(void)
229 int ret = MEDIA_CONTENT_ERROR_NONE;
231 ret = audio_meta_destroy(g_audio_dst);
233 dts_check_eq("utc_audio_meta_destroy_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to destroy audio_meta object");
237 * @brief Negative test case of imageinfo_clone()
239 static void utc_audio_meta_clone_n(void)
241 int ret = MEDIA_CONTENT_ERROR_NONE;
243 ret = audio_meta_clone(&g_audio_dst, NULL);
244 dts_check_eq("utc_audio_meta_clone_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
248 * @brief Positive test case of imageinfo_clone()
250 static void utc_audio_meta_clone_p(void)
252 int ret = MEDIA_CONTENT_ERROR_NONE;
254 ret = audio_meta_clone(&g_audio_dst, g_audio);
256 dts_check_eq("utc_audio_meta_clone_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to clone audio_meta object");
260 * @brief Negative test case of audio_meta_get_media_id()
262 static void utc_audio_meta_get_media_id_n(void)
264 int ret = MEDIA_CONTENT_ERROR_NONE;
265 char *media_id = NULL;
267 ret = audio_meta_get_media_id(NULL, &media_id);
269 dts_check_eq("utc_audio_meta_get_media_id_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
273 * @brief Positive test case of audio_meta_get_media_id()
275 static void utc_audio_meta_get_media_id_p(void)
277 int ret = MEDIA_CONTENT_ERROR_NONE;
278 char *media_id = NULL;
280 ret = audio_meta_get_media_id(g_audio, &media_id);
282 dts_check_eq("utc_audio_meta_get_media_id_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get album");
286 * @brief Negative test case of imageinfo_get_latitude()
288 static void utc_audio_meta_get_title_n(void)
290 int ret = MEDIA_CONTENT_ERROR_NONE;
293 ret = audio_meta_get_title(NULL, &title);
295 dts_check_eq("utc_audio_meta_get_album_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
299 * @brief Positive test case of imageinfo_get_latitude()
301 static void utc_audio_meta_get_title_p(void)
303 int ret = MEDIA_CONTENT_ERROR_NONE;
306 ret = audio_meta_get_title(g_audio, &title);
311 dts_check_eq("utc_audio_meta_get_album_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get album");
315 * @brief Negative test case of imageinfo_get_latitude()
317 static void utc_audio_meta_get_album_n(void)
319 int ret = MEDIA_CONTENT_ERROR_NONE;
322 ret = audio_meta_get_album(NULL, &album);
324 dts_check_eq("utc_audio_meta_get_album_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
328 * @brief Positive test case of imageinfo_get_latitude()
330 static void utc_audio_meta_get_album_p(void)
332 int ret = MEDIA_CONTENT_ERROR_NONE;
335 ret = audio_meta_get_album(g_audio, &album);
340 dts_check_eq("utc_audio_meta_get_album_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get album");
344 * @brief Negative test case of imageinfo_get_description()
346 static void utc_audio_meta_get_artist_n(void)
348 int ret = MEDIA_CONTENT_ERROR_NONE;
351 ret = audio_meta_get_artist(NULL, &artist);
353 dts_check_eq("utc_audio_meta_get_artist_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
357 * @brief Positive test case of imageinfo_get_description()
359 static void utc_audio_meta_get_artist_p(void)
361 int ret = MEDIA_CONTENT_ERROR_NONE;
364 ret = audio_meta_get_artist(g_audio, &artist);
369 dts_check_eq("utc_audio_meta_get_artist_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get artist");
373 * @brief Negative test case of audio_meta_get_genre()
375 static void utc_audio_meta_get_genre_n(void)
377 int ret = MEDIA_CONTENT_ERROR_NONE;
380 ret = audio_meta_get_genre(NULL, &genre);
381 dts_check_eq("utc_audio_meta_get_genre_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
385 * @brief Positive test case of audio_meta_get_genre()
387 static void utc_audio_meta_get_genre_p(void)
389 int ret = MEDIA_CONTENT_ERROR_NONE;
392 ret = audio_meta_get_genre(g_audio, &genre);
397 dts_check_eq("utc_audio_meta_get_genre_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get genre");
401 * @brief Negative test case of audio_meta_get_composer()
403 static void utc_audio_meta_get_composer_n(void)
405 int ret = MEDIA_CONTENT_ERROR_NONE;
406 char *composer = NULL;
408 ret = audio_meta_get_composer(NULL, &composer);
409 dts_check_eq("utc_audio_meta_get_composer_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
414 * @brief Positive test case of audio_meta_get_composer()
416 static void utc_audio_meta_get_composer_p(void)
418 int ret = MEDIA_CONTENT_ERROR_NONE;
419 char *composer = NULL;
421 ret = audio_meta_get_composer(g_audio, &composer);
426 dts_check_eq("utc_audio_meta_get_composer_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get the composer");
430 * @brief Negative test case of sim_get_imageinfo_get_height()
432 static void utc_audio_meta_get_year_n(void)
434 int ret = MEDIA_CONTENT_ERROR_NONE;
437 ret = audio_meta_get_year(NULL, &year);
439 dts_check_eq("utc_audio_meta_get_year_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
443 * @brief Positive test case of sim_get_imageinfo_get_height()
445 static void utc_audio_meta_get_year_p(void)
447 int ret = MEDIA_CONTENT_ERROR_NONE;
450 ret = audio_meta_get_year(g_audio, &year);
455 dts_check_eq("utc_audio_meta_get_year_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get year");
459 * @brief Negative test case of audio_meta_get_recorded_date()
461 static void utc_audio_meta_get_recorded_date_n(void)
463 int ret = MEDIA_CONTENT_ERROR_NONE;
464 char *recorded_date = NULL;
466 ret = audio_meta_get_recorded_date(NULL, &recorded_date);
468 dts_check_eq("utc_audio_meta_get_recorded_date_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Failed to get recorded_date");
472 * @brief Positive test case of audio_meta_get_recorded_date()
474 static void utc_audio_meta_get_recorded_date_p(void)
476 int ret = MEDIA_CONTENT_ERROR_NONE;
477 char *recorded_date = NULL;
479 ret = audio_meta_get_year(g_audio, &recorded_date);
484 dts_check_eq("utc_audio_meta_get_recorded_date_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get recorded_date");
488 * @brief Negative test case of audio_meta_get_copyright()
490 static void utc_audio_meta_get_copyright_n(void)
492 int ret = MEDIA_CONTENT_ERROR_NONE;
493 char *copyright = NULL;
495 ret = audio_meta_get_copyright(NULL, ©right);
497 dts_check_eq("utc_audio_meta_get_copyright_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
501 * @brief Positive test case of audio_meta_get_copyright()
503 static void utc_audio_meta_get_copyright_p(void)
505 int ret = MEDIA_CONTENT_ERROR_NONE;
506 char *copyright = NULL;
508 ret = audio_meta_get_copyright(g_audio, ©right);
513 dts_check_eq("utc_audio_meta_get_copyright_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get copyright");
516 static void utc_audio_meta_get_track_num_n(void)
518 int ret = MEDIA_CONTENT_ERROR_NONE;
519 char *tracknum = NULL;
521 ret = audio_meta_get_track_num(NULL, &tracknum);
523 dts_check_eq("utc_audio_meta_get_track_num_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
526 static void utc_audio_meta_get_track_num_p(void)
528 int ret = MEDIA_CONTENT_ERROR_NONE;
529 char *tracknum = NULL;
531 ret = audio_meta_get_track_num(g_audio, &tracknum);
536 dts_check_eq("utc_audio_meta_get_track_num_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get track num");
539 static void utc_audio_meta_get_bit_rate_n(void)
541 int ret = MEDIA_CONTENT_ERROR_NONE;
544 ret = audio_meta_get_bit_rate(NULL, &bit_rate);
546 dts_check_eq("utc_audio_meta_get_bit_rate_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
549 static void utc_audio_meta_get_bit_rate_p(void)
551 int ret = MEDIA_CONTENT_ERROR_NONE;
554 ret = audio_meta_get_bit_rate(g_audio, &bit_rate);
556 dts_check_eq("utc_audio_meta_get_bit_rate_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get the bit_rate");
559 static void utc_audio_meta_get_sample_rate_n(void)
561 int ret = MEDIA_CONTENT_ERROR_NONE;
564 ret = audio_meta_get_sample_rate(NULL, &sample_rate);
566 dts_check_eq("utc_audio_meta_get_sample_rate_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
569 static void utc_audio_meta_get_sample_rate_p(void)
571 int ret = MEDIA_CONTENT_ERROR_NONE;
574 ret = audio_meta_get_sample_rate(g_audio, &sample_rate);
576 dts_check_eq("utc_audio_meta_get_sample_rate_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get the sample_rate");
579 static void utc_audio_meta_get_channel_n(void)
581 int ret = MEDIA_CONTENT_ERROR_NONE;
584 ret = audio_meta_get_channel(NULL, &channel);
586 dts_check_eq("utc_audio_meta_get_sample_rate_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
589 static void utc_audio_meta_get_channel_p(void)
591 int ret = MEDIA_CONTENT_ERROR_NONE;
594 ret = audio_meta_get_channel(g_audio, &channel);
596 dts_check_eq("utc_audio_meta_get_sample_rate_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get the channel");
599 static void utc_audio_meta_get_duration_n(void)
601 int ret = MEDIA_CONTENT_ERROR_NONE;
604 ret = audio_meta_get_duration(NULL, &duration);
606 dts_check_eq("utc_audio_meta_get_duration_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
609 static void utc_audio_meta_get_duration_p(void)
611 int ret = MEDIA_CONTENT_ERROR_NONE;
614 ret = audio_meta_get_duration(g_audio, &duration);
616 dts_check_eq("utc_audio_meta_get_duration_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get duration");
619 static void utc_audio_meta_get_played_count_n(void)
621 int ret = MEDIA_CONTENT_ERROR_NONE;
624 ret = audio_meta_get_played_count(NULL, &count);
626 dts_check_eq("utc_audio_meta_get_played_count_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
629 static void utc_audio_meta_get_played_count_p(void)
631 int ret = MEDIA_CONTENT_ERROR_NONE;
634 ret = audio_meta_get_played_count(g_audio, &count);
636 dts_check_eq("utc_audio_meta_get_played_count_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get played count");
639 static void utc_audio_meta_get_played_time_n(void)
641 int ret = MEDIA_CONTENT_ERROR_NONE;
642 time_t played_time = 0;
644 ret = audio_meta_get_played_time(NULL, &played_time);
646 dts_check_eq("utc_audio_meta_get_played_time_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
649 static void utc_audio_meta_get_played_time_p(void)
651 int ret = MEDIA_CONTENT_ERROR_NONE;
652 time_t played_time = 0;
654 ret = audio_meta_get_played_time(g_audio, &played_time);
656 dts_check_eq("utc_audio_meta_get_played_time_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get played time");
659 static void utc_audio_meta_get_played_position_n(void)
661 int ret = MEDIA_CONTENT_ERROR_NONE;
664 ret = audio_meta_get_played_position(NULL, &position);
666 dts_check_eq("utc_audio_meta_get_played_position_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
669 static void utc_audio_meta_get_played_position_p(void)
671 int ret = MEDIA_CONTENT_ERROR_NONE;
674 ret = audio_meta_get_played_position(g_audio, &position);
676 dts_check_eq("utc_audio_meta_get_played_position_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get played position");
679 static void utc_audio_meta_set_played_count_n(void)
681 int ret = MEDIA_CONTENT_ERROR_NONE;
682 int played_count = 3;
684 ret = audio_meta_set_played_count(NULL, played_count);
686 dts_check_eq("utc_audio_meta_set_played_count_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
689 static void utc_audio_meta_set_played_count_p(void)
691 int ret = MEDIA_CONTENT_ERROR_NONE;
692 int played_count = 3;
694 ret = audio_meta_set_played_count(g_audio, played_count);
696 dts_check_eq("utc_audio_meta_set_played_count_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to set played count");
699 static void utc_audio_meta_set_played_time_n(void)
701 int ret = MEDIA_CONTENT_ERROR_NONE;
702 time_t played_time = 0;
704 ret = audio_meta_set_played_time(NULL, played_time);
706 dts_check_eq("utc_audio_meta_set_played_time_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
709 static void utc_audio_meta_set_played_time_p(void)
711 int ret = MEDIA_CONTENT_ERROR_NONE;
712 time_t played_time = 0;
714 ret = audio_meta_set_played_time(g_audio, played_time);
716 dts_check_eq("utc_audio_meta_set_played_time_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to set played time");
719 static void utc_audio_meta_set_played_position_n(void)
721 int ret = MEDIA_CONTENT_ERROR_NONE;
722 int played_position = 0;
724 ret = audio_meta_set_played_position(NULL, played_position);
726 dts_check_eq("audio_meta_set_played_position", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
729 static void utc_audio_meta_set_played_position_p(void)
731 int ret = MEDIA_CONTENT_ERROR_NONE;
732 int played_position = 0;
734 ret = audio_meta_set_played_position(g_audio, played_position);
736 dts_check_eq("utc_audio_meta_set_played_position_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to set playedposition");
739 static void utc_audio_meta_update_to_db_n(void)
741 int ret = MEDIA_CONTENT_ERROR_NONE;
743 ret = audio_meta_update_to_db(NULL);
745 dts_check_eq("utc_audio_meta_update_to_db_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
748 static void utc_audio_meta_update_to_db_p(void)
750 int ret = MEDIA_CONTENT_ERROR_NONE;
752 tet_printf("audio : 0x%x\n", g_audio);
753 ret = audio_meta_update_to_db(g_audio);
755 dts_check_eq("utc_audio_meta_update_to_db_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to update metadata");