b58296dc9e5f50ea2bf99d3e1c1e1f7d056037b4
[framework/api/media-content.git] / TC / testcase / utc_media_video.c
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18 #include <tet_api.h>
19 #include <media_content.h>
20
21 #include <stdlib.h>
22
23 static void startup(void);
24 static void cleanup(void);
25
26 void (*tet_startup)(void) = startup;
27 void (*tet_cleanup)(void) = cleanup;
28
29 static void utc_video_meta_destroy_n(void);
30 static void utc_video_meta_destroy_p(void);
31 static void utc_video_meta_clone_n(void);
32 static void utc_video_meta_clone_p(void);
33 static void utc_video_meta_get_media_id_n(void);
34 static void utc_video_meta_get_media_id_p(void);
35 static void utc_video_meta_get_title_n(void);
36 static void utc_video_meta_get_title_p(void);
37 static void utc_video_meta_get_album_n(void);
38 static void utc_video_meta_get_album_p(void);
39 static void utc_video_meta_get_artist_n(void);
40 static void utc_video_meta_get_artist_p(void);
41 static void utc_video_meta_get_genre_n(void);
42 static void utc_video_meta_get_genre_p(void);
43 static void utc_video_meta_get_composer_n(void);
44 static void utc_video_meta_get_composer_p(void);
45 static void utc_video_meta_get_year_n(void);
46 static void utc_video_meta_get_year_p(void);
47 static void utc_video_meta_get_recorded_date_n(void);
48 static void utc_video_meta_get_recorded_date_p(void);
49 static void utc_video_meta_get_copyright_n(void);
50 static void utc_video_meta_get_copyright_p(void);
51 static void utc_video_meta_get_track_num_n(void);
52 static void utc_video_meta_get_track_num_p(void);
53 static void utc_video_meta_get_bit_rate_n(void);
54 static void utc_video_meta_get_bit_rate_p(void);
55 static void utc_video_meta_get_duration_n(void);
56 static void utc_video_meta_get_duration_p(void);
57 static void utc_video_meta_get_width_n(void);
58 static void utc_video_meta_get_width_p(void);
59 static void utc_video_meta_get_height_n(void);
60 static void utc_video_meta_get_height_p(void);
61 static void utc_video_meta_get_played_count_n(void);
62 static void utc_video_meta_get_played_count_p(void);
63 static void utc_video_meta_get_played_time_n(void);
64 static void utc_video_meta_get_played_time_p(void);
65 static void utc_video_meta_get_played_position_n(void);
66 static void utc_video_meta_get_played_position_p(void);
67 static void utc_video_meta_update_to_db_n(void);
68 static void utc_video_meta_update_to_db_p(void);
69 static void utc_video_meta_set_played_count_n(void);
70 static void utc_video_meta_set_played_count_p(void);
71 static void utc_video_meta_set_played_time_n(void);
72 static void utc_video_meta_set_played_time_p(void);
73 static void utc_video_meta_set_played_position_n(void);
74 static void utc_video_meta_set_played_position_p(void);
75
76
77 struct tet_testlist tet_testlist[] = {
78         { utc_video_meta_destroy_n, 5 },
79         { utc_video_meta_destroy_p, 5 },
80         { utc_video_meta_clone_n, 4 },
81         { utc_video_meta_clone_p, 4 },
82         { utc_video_meta_get_media_id_n, 1 },
83         { utc_video_meta_get_media_id_p, 1 },
84         { utc_video_meta_get_title_n, 1 },
85         { utc_video_meta_get_title_p, 1 },
86         { utc_video_meta_get_album_n, 1 },
87         { utc_video_meta_get_album_p, 1 },
88         { utc_video_meta_get_artist_n, 1 },
89         { utc_video_meta_get_artist_p, 1 },
90         { utc_video_meta_get_genre_n, 1 },
91         { utc_video_meta_get_genre_p, 1 },
92         { utc_video_meta_get_composer_n, 1 },
93         { utc_video_meta_get_composer_p, 1 },
94         { utc_video_meta_get_year_n, 1 },
95         { utc_video_meta_get_year_p, 1 },
96         { utc_video_meta_get_recorded_date_n, 1 },
97         { utc_video_meta_get_recorded_date_p, 1 },
98         { utc_video_meta_get_copyright_n, 1 },
99         { utc_video_meta_get_copyright_p, 1 },
100         { utc_video_meta_get_track_num_n, 1 },
101         { utc_video_meta_get_track_num_p, 1 },
102         { utc_video_meta_get_bit_rate_n, 1 },
103         { utc_video_meta_get_bit_rate_p, 1 },
104         { utc_video_meta_get_duration_n, 1 },
105         { utc_video_meta_get_duration_p, 1 },
106         { utc_video_meta_get_width_n, 1 },
107         { utc_video_meta_get_width_p, 1 },
108         { utc_video_meta_get_height_n, 1 },
109         { utc_video_meta_get_height_p, 1 },
110         { utc_video_meta_get_played_count_n, 1 },
111         { utc_video_meta_get_played_count_p, 1 },
112         { utc_video_meta_get_played_time_n, 1 },
113         { utc_video_meta_get_played_time_p, 1 },
114         { utc_video_meta_get_played_position_n, 1 },
115         { utc_video_meta_get_played_position_p, 1 },
116         { utc_video_meta_set_played_count_n, 2 },
117         { utc_video_meta_set_played_count_p, 2 },
118         { utc_video_meta_set_played_time_n, 2 },
119         { utc_video_meta_set_played_time_p, 2 },
120         { utc_video_meta_set_played_position_n, 2 },
121         { utc_video_meta_set_played_position_p, 2 },
122         { utc_video_meta_update_to_db_n, 3 },
123         { utc_video_meta_update_to_db_p, 3 },
124         { NULL, 0 },
125 };
126
127 static video_meta_h g_video;
128 static video_meta_h g_video_dst;
129 char *g_media_id = NULL;
130
131 bool media_item_cb(media_info_h media, void *user_data)
132 {
133         int ret = MEDIA_CONTENT_ERROR_NONE;
134
135         ret = media_info_get_media_id(media, &g_media_id);
136         if((ret != MEDIA_CONTENT_ERROR_NONE) || (g_media_id == NULL))
137         {
138                 tet_printf("\n get media_id failed");
139                 return false;
140         }
141
142         ret = media_info_get_video(media, &g_video);
143         if((ret != MEDIA_CONTENT_ERROR_NONE) || (g_video == NULL))
144         {
145                 tet_printf("\n get video_meta failed");
146                 return false;
147         }
148
149         return true;
150 }
151
152 static void startup(void)
153 {
154         /* start of TC */
155         tet_printf("\n TC start");
156         filter_h filter;
157         g_video = NULL;
158
159         int ret = media_content_connect();
160         if(ret != MEDIA_CONTENT_ERROR_NONE)
161         {
162                 tet_printf("\n database connection is failed");
163                 return;
164         }
165         else
166         {
167                 tet_printf("\n database connection is success");
168         }
169
170         char *condition = "MEDIA_TYPE=1";       //Video
171
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);
175         if(filter == NULL)
176         {
177                 tet_printf("\n filter create failed");
178                 return;
179         }
180
181         ret = media_info_foreach_media_from_db(filter, media_item_cb, NULL);
182         if(ret != MEDIA_CONTENT_ERROR_NONE)
183         {
184                 tet_printf("\n get media_info failed");
185                 return;
186         }
187
188         media_filter_destroy(filter);
189
190         tet_printf("\n TC start END");
191 }
192
193
194 static void cleanup(void)
195 {
196         /* end of TC */
197         tet_printf("\n TC end");
198
199         if(g_media_id != NULL)
200                 free(g_media_id);
201
202         if(g_video != NULL)
203                 video_meta_destroy(g_video);
204
205         int ret = media_content_disconnect();
206         
207         if(ret != MEDIA_CONTENT_ERROR_NONE)
208                 tet_printf("\n database disconnection is failed");
209         else
210                 tet_printf("\n database disconnection is success");
211 }
212
213
214 /**
215  * @brief Negative test case of content_imageinfo_destroy()
216  */
217 static void utc_video_meta_destroy_n(void)
218 {
219         int ret = MEDIA_CONTENT_ERROR_NONE;
220
221         ret = video_meta_destroy(NULL);
222
223         dts_check_eq("utc_video_meta_destroy", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
224 }
225
226
227 /**
228  * @brief Positive test case of content_imageinfo_destroy()
229  */
230 static void utc_video_meta_destroy_p(void)
231 {
232         int ret = MEDIA_CONTENT_ERROR_NONE;
233
234         ret = video_meta_destroy(g_video_dst);
235
236         dts_check_eq("utc_video_meta_destroy", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to destroy videoinfo object");
237
238 }
239
240 /**
241  * @brief Negative test case of imageinfo_clone()
242  */
243 static void utc_video_meta_clone_n(void)
244 {
245         int ret = MEDIA_CONTENT_ERROR_NONE;
246         
247         ret = video_meta_clone(&g_video_dst, NULL);
248
249         dts_check_eq("utc_video_meta_clone", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
250 }
251
252 /**
253  * @brief Positive test case of imageinfo_clone()
254  */
255 static void utc_video_meta_clone_p(void)
256 {
257         int ret = MEDIA_CONTENT_ERROR_NONE;
258         
259         ret = video_meta_clone(&g_video_dst, g_video);
260
261         dts_check_eq("utc_video_meta_clone", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to clone videoinfo object");
262 }
263
264 static void utc_video_meta_get_media_id_n(void)
265 {
266         int ret = MEDIA_CONTENT_ERROR_NONE;
267         char *media_id = NULL;
268
269         ret = video_meta_get_media_id(NULL, &media_id);
270
271         dts_check_eq("utc_video_meta_get_media_id_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
272 }
273
274 static void utc_video_meta_get_media_id_p(void)
275 {
276         int ret = MEDIA_CONTENT_ERROR_NONE;
277         char *media_id = NULL;
278
279         ret = video_meta_get_media_id(g_video, &media_id);
280
281         dts_check_eq("utc_video_meta_get_media_id_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get video id");
282 }
283
284 /**
285  * @brief Negative test case of sim_get_imageinfo_get_height()
286  */
287 static void utc_video_meta_get_title_n(void)
288 {
289         int ret = MEDIA_CONTENT_ERROR_NONE;
290         char *title = NULL;
291
292         ret = video_meta_get_title(NULL, &title);
293
294         dts_check_eq("utc_video_meta_get_title", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
295 }
296
297 /**
298  * @brief Positive test case of sim_get_imageinfo_get_height()
299  */
300 static void utc_video_meta_get_title_p(void)
301 {
302
303         int ret = MEDIA_CONTENT_ERROR_NONE;
304         char *title = NULL;
305
306         ret = video_meta_get_title(g_video, &title);
307
308         if(title)
309                 free(title);
310
311         dts_check_eq("utc_video_meta_get_title", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get the title");
312 }
313
314 /**
315  * @brief Negative test case of imageinfo_get_description()
316  */
317 static void utc_video_meta_get_album_n(void)
318 {
319         int ret = MEDIA_CONTENT_ERROR_NONE;
320         char *album = NULL;
321
322         ret = video_meta_get_album(NULL, &album);
323
324         dts_check_eq("utc_video_meta_get_album", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
325 }
326
327 /**
328  * @brief Positive test case of imageinfo_get_description()
329  */
330 static void utc_video_meta_get_album_p(void)
331 {
332         int ret = MEDIA_CONTENT_ERROR_NONE;
333         char *album = NULL;
334
335         ret = video_meta_get_album(g_video, &album);
336
337         if(album)
338                 free(album);
339
340         dts_check_eq("utc_video_meta_get_album", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get the album");
341 }
342
343 /**
344  * @brief Negative test case of imageinfo_get_width()
345  */
346 static void utc_video_meta_get_artist_n(void)
347 {
348         int ret = MEDIA_CONTENT_ERROR_NONE;
349         char *artist = NULL;
350
351         ret = video_meta_get_artist(NULL, &artist);
352
353         dts_check_eq("utc_video_meta_get_artist", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
354 }
355
356 /**
357  * @brief Positive test case of imageinfo_get_width()
358  */
359 static void utc_video_meta_get_artist_p(void)
360 {
361         int ret = MEDIA_CONTENT_ERROR_NONE;
362         char *artist = NULL;
363
364         ret = video_meta_get_artist(g_video, &artist);
365
366         if(artist)
367                 free(artist);
368
369         dts_check_eq("utc_video_meta_get_artist", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get the artist");
370 }
371
372 /**
373  * @brief Negative test case of video_meta_get_genre()
374  */
375 static void utc_video_meta_get_genre_n(void)
376 {
377         int ret = MEDIA_CONTENT_ERROR_NONE;
378         char *genre = NULL;
379
380         ret = video_meta_get_genre(NULL, &genre);
381
382         dts_check_eq("utc_video_meta_get_genre_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
383 }
384
385
386 /**
387  * @brief Positive test case of video_meta_get_genre()
388  */
389 static void utc_video_meta_get_genre_p(void)
390 {
391         int ret = MEDIA_CONTENT_ERROR_NONE;
392         char *genre = NULL;
393
394         ret = video_meta_get_genre(g_video, &genre);
395
396         if(genre)
397                 free(genre);
398
399         dts_check_eq("utc_video_meta_get_genre_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get genre");
400 }
401
402 /**
403  * @brief Negative test case of video_meta_get_composer()
404  */
405 static void utc_video_meta_get_composer_n(void)
406 {
407         int ret = MEDIA_CONTENT_ERROR_NONE;
408         char *composer = NULL;
409
410         ret = video_meta_get_composer(NULL, &composer);
411
412         dts_check_eq("utc_video_meta_get_composer_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
413 }
414
415 /**
416  * @brief Positive test case of video_meta_get_composer()
417  */
418 static void utc_video_meta_get_composer_p(void)
419 {
420         int ret = MEDIA_CONTENT_ERROR_NONE;
421         char *composer = NULL;
422
423         ret = video_meta_get_composer(g_video, &composer);
424
425         if(composer)
426                 free(composer);
427
428         dts_check_eq("utc_video_meta_get_composer_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get the composer");
429 }
430
431 /**
432  * @brief Negative test case of sim_get_imageinfo_get_height()
433  */
434 static void utc_video_meta_get_year_n(void)
435 {
436         int ret = MEDIA_CONTENT_ERROR_NONE;
437         char *year = NULL;
438
439         ret = video_meta_get_year(NULL, &year);
440
441         dts_check_eq("utc_video_meta_get_year_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
442 }
443
444
445 /**
446  * @brief Positive test case of sim_get_imageinfo_get_height()
447  */
448 static void utc_video_meta_get_year_p(void)
449 {
450         int ret = MEDIA_CONTENT_ERROR_NONE;
451         char *year = NULL;
452
453         ret = video_meta_get_year(g_video, &year);
454
455         if(year)
456                 free(year);
457
458         dts_check_eq("utc_video_meta_get_year_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get year");
459 }
460
461 /**
462  * @brief Negative test case of video_meta_get_recorded_date()
463  */
464 static void utc_video_meta_get_recorded_date_n(void)
465 {
466         int ret = MEDIA_CONTENT_ERROR_NONE;
467         char *recorded_date = NULL;
468
469         ret = video_meta_get_recorded_date(NULL, &recorded_date);
470
471         dts_check_eq("utc_video_meta_get_recorded_date_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Failed to get recorded_date");
472 }
473
474 /**
475  * @brief Positive test case of video_meta_get_recorded_date()
476  */
477 static void utc_video_meta_get_recorded_date_p(void)
478 {
479         int ret = MEDIA_CONTENT_ERROR_NONE;
480         char *recorded_date = NULL;
481
482         ret = video_meta_get_year(g_video, &recorded_date);
483
484         if(recorded_date)
485                 free(recorded_date);
486
487         dts_check_eq("utc_video_meta_get_recorded_date_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get recorded_date");
488 }
489
490 /**
491  * @brief Negative test case of video_meta_get_copyright()
492  */
493 static void utc_video_meta_get_copyright_n(void)
494 {
495         int ret = MEDIA_CONTENT_ERROR_NONE;
496         char *copyright = NULL;
497
498         ret = video_meta_get_copyright(NULL, &copyright);
499
500         dts_check_eq("utc_video_meta_get_copyright_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
501 }
502
503 /**
504  * @brief Positive test case of video_meta_get_copyright()
505  */
506 static void utc_video_meta_get_copyright_p(void)
507 {
508         int ret = MEDIA_CONTENT_ERROR_NONE;
509         char *copyright = NULL;
510
511         ret = video_meta_get_copyright(g_video, &copyright);
512
513         if(copyright)
514                         free(copyright);
515
516         dts_check_eq("utc_video_meta_get_copyright_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get copyright");
517 }
518
519 static void utc_video_meta_get_track_num_n(void)
520 {
521         int ret = MEDIA_CONTENT_ERROR_NONE;
522         char *track_num = NULL;
523
524         ret = video_meta_get_track_num(NULL, &track_num);
525
526         dts_check_eq("utc_video_meta_get_track_num_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
527 }
528
529 static void utc_video_meta_get_track_num_p(void)
530 {
531         int ret = MEDIA_CONTENT_ERROR_NONE;
532         char *track_num = NULL;
533
534         ret = video_meta_get_track_num(g_video, &track_num);
535
536         if(track_num)
537                 free(track_num);
538
539         dts_check_eq("utc_video_meta_get_track_num_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get track num");
540 }
541
542 static void utc_video_meta_get_bit_rate_n(void)
543 {
544         int ret = MEDIA_CONTENT_ERROR_NONE;
545         int bit_rate = 0;
546
547         ret = video_meta_get_bit_rate(NULL, &bit_rate);
548
549         dts_check_eq("utc_video_meta_get_bit_rate_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
550 }
551
552 static void utc_video_meta_get_bit_rate_p(void)
553 {
554         int ret = MEDIA_CONTENT_ERROR_NONE;
555         int bit_rate = 0;
556
557         ret = video_meta_get_bit_rate(g_video, &bit_rate);
558
559         dts_check_eq("utc_video_meta_get_bit_rate_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get the bit_rate");
560 }
561
562 static void utc_video_meta_get_duration_n(void)
563 {
564         int ret = MEDIA_CONTENT_ERROR_NONE;
565         int duration = 0;
566
567         ret = video_meta_get_duration(NULL, &duration);
568
569         dts_check_eq("utc_video_meta_get_duration", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
570 }
571
572 static void utc_video_meta_get_duration_p(void)
573 {
574         int ret = MEDIA_CONTENT_ERROR_NONE;
575         int duration = 0;
576
577         ret = video_meta_get_duration(g_video, &duration);
578
579         dts_check_eq("utc_video_meta_get_duration", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get a duration");
580 }
581
582 static void utc_video_meta_get_width_n(void)
583 {
584         int ret = MEDIA_CONTENT_ERROR_NONE;
585         int width = 0;
586         ret = video_meta_get_width(NULL, &width);
587
588         dts_check_eq("utc_video_meta_get_width", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
589 }
590
591 static void utc_video_meta_get_width_p(void)
592 {
593         int ret = MEDIA_CONTENT_ERROR_NONE;
594         int width = 0;
595
596         ret = video_meta_get_width(g_video, &width);
597         
598         dts_check_eq("utc_video_meta_get_width", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get a width");
599 }
600
601
602 static void utc_video_meta_get_height_n(void)
603 {
604         int ret = MEDIA_CONTENT_ERROR_NONE;
605         int height = 0;
606
607         ret = video_meta_get_height(NULL, &height);
608         
609         dts_check_eq("utc_video_meta_get_height", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
610 }
611
612 static void utc_video_meta_get_height_p(void)
613 {
614         int ret = MEDIA_CONTENT_ERROR_NONE;
615         int height = 0;
616
617         ret = video_meta_get_height(g_video, &height);
618
619         dts_check_eq("utc_video_meta_get_height", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get a height");
620 }
621
622 static void utc_video_meta_get_played_count_n(void)
623 {
624         int ret = MEDIA_CONTENT_ERROR_NONE;
625         int count = 0;
626
627         ret = video_meta_get_played_count(NULL, &count);
628
629         dts_check_eq("utc_video_meta_get_played_count_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
630 }
631
632 static void utc_video_meta_get_played_count_p(void)
633 {
634         int ret = MEDIA_CONTENT_ERROR_NONE;
635         int count = 0;
636
637         ret = video_meta_get_played_count(g_video, &count);
638
639         dts_check_eq("utc_video_meta_get_played_count_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get played count");
640 }
641
642 static void utc_video_meta_get_played_time_n(void)
643 {
644         int ret = MEDIA_CONTENT_ERROR_NONE;
645         time_t played_time = 0;
646
647         ret = video_meta_get_played_time(NULL, &played_time);
648
649         dts_check_eq("utc_video_meta_get_played_time_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
650 }
651
652 static void utc_video_meta_get_played_time_p(void)
653 {
654         int ret = MEDIA_CONTENT_ERROR_NONE;
655         time_t played_time = 0;
656
657         ret = video_meta_get_played_time(g_video, &played_time);
658
659         dts_check_eq("utc_video_meta_get_played_time_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get played time");
660 }
661
662 static void utc_video_meta_get_played_position_n(void)
663 {
664         int ret = MEDIA_CONTENT_ERROR_NONE;
665         int position = 0;
666
667         ret = video_meta_get_played_position(NULL, &position);
668
669         dts_check_eq("utc_video_meta_get_played_position_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
670 }
671
672 static void utc_video_meta_get_played_position_p(void)
673 {
674         int ret = MEDIA_CONTENT_ERROR_NONE;
675         int position = 0;
676
677         ret = video_meta_get_played_position(g_video, &position);
678
679         dts_check_eq("utc_video_meta_get_played_position_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to get played position");
680 }
681
682 static void utc_video_meta_set_played_count_n(void)
683 {
684         int ret = MEDIA_CONTENT_ERROR_NONE;
685         int played_count = 3;
686
687         ret = video_meta_set_played_count(NULL, played_count);
688
689         dts_check_eq("utc_video_meta_set_played_count_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
690 }
691
692 static void utc_video_meta_set_played_count_p(void)
693 {
694         int ret = MEDIA_CONTENT_ERROR_NONE;
695         int played_count = 3;
696
697         ret = video_meta_set_played_count(g_video, played_count);
698
699         dts_check_eq("utc_video_meta_set_played_count_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to set played count");
700 }
701
702 static void utc_video_meta_set_played_time_n(void)
703 {
704         int ret = MEDIA_CONTENT_ERROR_NONE;
705         time_t played_time = 0;
706
707         ret = video_meta_set_played_time(NULL, played_time);
708
709         dts_check_eq("utc_video_meta_set_played_time_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
710 }
711
712 static void utc_video_meta_set_played_time_p(void)
713 {
714         int ret = MEDIA_CONTENT_ERROR_NONE;
715         time_t played_time = 0;
716
717         ret = video_meta_set_played_time(g_video, played_time);
718
719         dts_check_eq("utc_video_meta_set_played_time_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to set played time");
720 }
721
722 static void utc_video_meta_set_played_position_n(void)
723 {
724         int ret = MEDIA_CONTENT_ERROR_NONE;
725         int played_position = 0;
726
727         ret = video_meta_set_played_position(NULL, played_position);
728
729         dts_check_eq("video_meta_set_played_position", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
730 }
731
732 static void utc_video_meta_set_played_position_p(void)
733 {
734         int ret = MEDIA_CONTENT_ERROR_NONE;
735         int played_position = 0;
736
737         ret = video_meta_set_played_position(g_video, played_position);
738
739         dts_check_eq("utc_video_meta_set_played_position_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to set playedposition");
740 }
741
742 static void utc_video_meta_update_to_db_n(void)
743 {
744         int ret = MEDIA_CONTENT_ERROR_NONE;
745
746         ret = video_meta_update_to_db(NULL);
747
748         dts_check_eq("utc_video_meta_update_to_db_n", ret, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Must return MEDIA_CONTENT_ERROR_INVALID_PARAMETER in case of invalid parameter");
749 }
750
751 static void utc_video_meta_update_to_db_p(void)
752 {
753         int ret = MEDIA_CONTENT_ERROR_NONE;
754
755         ret = video_meta_update_to_db(g_video);
756
757         dts_check_eq("utc_video_meta_update_to_db_p", ret, MEDIA_CONTENT_ERROR_NONE, "Failed to update metadata");
758 }