b9f54fc91d1b8a953fa8240fa98f1582650ddc70
[framework/api/face.git] / TC / testcase / utc_uix_face_detect_video_negative.c
1 /*
2  *
3  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of SAMSUNG
7  * ELECTRONICS ("Confidential Information"). You agree and acknowledge that
8  * this software is owned by Samsung and you shall not disclose such
9  * Confidential Information and shall use it only in accordance with the terms
10  * of the license agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG
11  * make no representations or warranties about the suitability of the software,
12  * either express or implied, including but not limited to the implied
13  * warranties of merchantability, fitness for a particular purpose, or
14  * non-infringement. SAMSUNG shall not be liable for any damages suffered by
15  * licensee arising out of or related to this software.
16  *
17  */
18 #include <stdio.h>
19 #include <tet_api.h>
20
21 #include <face.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
30 #define TESTVIDEO_NAME (DATADIR"suzie_qcif.yuv")
31 #define TESTVIDEO_WIDTH (176)
32 #define TESTVIDEO_HEIGHT (144)
33 #define TESTVIDEO_FRAME (10)
34
35 static void startup(void)
36 {
37 // TODO : How to copy sample image????
38 }
39
40 static void cleanup(void)
41 {
42         /* end of TC */
43 }
44
45
46 static void utc_uix_face_detect_faces_from_video_stream_negative_01(void)
47 {
48         static const char szFunc[] = "face_detect_faces_from_video_stream";
49
50         int err;
51
52         face_h face;
53
54     err = face_create(&face);
55
56         char *filename = TESTVIDEO_NAME;
57         int nW = TESTVIDEO_WIDTH;
58         int nH = TESTVIDEO_HEIGHT;
59
60         unsigned char YBuf[nW*nH];
61
62         FILE *fp;
63         int nRead;
64
65         fp = fopen(filename, "rb");
66         if ( fp == NULL )
67         {
68                 tet_printf("Cannot load file. %s", filename);
69                 tet_result(TET_UNRESOLVED);
70                 return;
71         }
72
73
74         face_image_h image;
75
76         int nCount = 0;
77
78         face_rect_s *rects = NULL;
79
80         int i;
81         for ( i = 0; i < TESTVIDEO_FRAME; i++)
82         {
83                 nRead = fread (YBuf, 1, nW * nH, fp );
84
85                 if ( nRead != nW * nH )
86                 {
87                         // Error
88                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
89                         tet_result(TET_UNRESOLVED);
90                         return ;
91                 }
92
93                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf, nW, nH, nW * nH, &image);
94
95                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, image, NULL, &nCount );
96                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);
97
98                 face_image_destroy(image);
99
100         }
101
102         err = face_destroy(face);
103
104         fclose(fp);
105
106 }
107
108 static void utc_uix_face_detect_faces_from_video_stream_negative_02(void)
109 {
110         static const char szFunc[] = "face_detect_faces_from_video_stream";
111
112         int err;
113
114         face_h face;
115
116     err = face_create(&face);
117
118         char *filename = TESTVIDEO_NAME;
119         int nW = TESTVIDEO_WIDTH;
120         int nH = TESTVIDEO_HEIGHT;
121
122         unsigned char YBuf[nW*nH];
123
124         FILE *fp;
125         int nRead;
126
127         fp = fopen(filename, "rb");
128         if ( fp == NULL )
129         {
130                 tet_printf("Cannot load file. %s", filename);
131                 tet_result(TET_UNRESOLVED);
132                 return;
133         }
134
135
136         face_image_h image;
137
138         int nCount = 0;
139
140         face_rect_s *rects = NULL;
141
142         int i;
143         for ( i = 0; i < TESTVIDEO_FRAME; i++)
144         {
145                 nRead = fread (YBuf, 1, nW * nH, fp );
146
147                 if ( nRead != nW * nH )
148                 {
149                         // Error
150                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
151                         tet_result(TET_UNRESOLVED);
152                         return ;
153                 }
154
155                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf, nW, nH, nW * nH, &image);
156
157                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, image, &rects, NULL );
158                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);
159
160                 face_image_destroy(image);
161         }
162
163         err = face_destroy(face);
164
165         fclose(fp);
166
167 }
168
169
170
171 static void utc_uix_face_detect_faces_from_video_stream_negative_03(void)
172 {
173         static const char szFunc[] = "face_detect_faces_from_video_stream";
174
175         int err;
176
177         face_h face;
178
179     err = face_create(&face);
180
181         char *filename = TESTVIDEO_NAME;
182         int nW = TESTVIDEO_WIDTH;
183         int nH = TESTVIDEO_HEIGHT;
184
185         unsigned char YBuf[nW*nH];
186
187         FILE *fp;
188         int nRead;
189
190         fp = fopen(filename, "rb");
191         if ( fp == NULL )
192         {
193                 tet_printf("Cannot load file. %s", filename);
194                 tet_result(TET_UNRESOLVED);
195                 return;
196         }
197
198
199         face_image_h image;
200
201         int nCount = 0;
202
203         face_rect_s *rects = NULL;
204
205         int i;
206         for ( i = 0; i < TESTVIDEO_FRAME; i++)
207         {
208                 nRead = fread (YBuf, 1, nW * nH, fp );
209
210                 if ( nRead != nW * nH )
211                 {
212                         // Error
213                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
214                         tet_result(TET_UNRESOLVED);
215                         return ;
216                 }
217
218                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf, nW, nH, nW * nH, &image);
219
220                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, NULL, &rects, &nCount );
221                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);
222
223                 face_image_destroy(image);
224         }
225
226         err = face_destroy(face);
227
228         fclose(fp);
229
230 }
231
232
233 static void utc_uix_face_extract_component_negative_01(void)
234 {
235         static const char szFunc[] = "face_extract_component";
236
237         int err;
238
239         face_h face;
240
241     err = face_create(&face);
242
243         char *filename = TESTVIDEO_NAME;
244         int nW = TESTVIDEO_WIDTH;
245         int nH = TESTVIDEO_HEIGHT;
246
247         unsigned char YBuf[nW*nH];
248
249         FILE *fp;
250         int nRead;
251
252         fp = fopen(filename, "rb");
253         if ( fp == NULL )
254         {
255                 tet_printf("Cannot load file. %s", filename);
256                 tet_result(TET_UNRESOLVED);
257                 return;
258         }
259
260         face_image_h image;
261
262         int nCount = 0;
263
264         face_rect_s *rects = NULL;
265         face_component_h component;
266
267         int i;
268
269         for ( i = 0; i < TESTVIDEO_FRAME; i++)
270         {
271                 nRead = fread (YBuf, 1, nW * nH, fp );
272
273                 if ( nRead != nW * nH )
274                 {
275                         // Error
276                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
277                         tet_result(TET_UNRESOLVED);
278                         return ;
279                 }
280
281                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf, nW, nH, nW * nH, &image);
282
283                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, image, &rects, &nCount );
284
285                 if ( err != FACE_ERROR_NONE )
286                 {
287                         tet_printf("[F:%20s L%4d] Detect face Error! err=%d\n", __FUNCTION__, __LINE__, err);
288                         tet_result(TET_UNRESOLVED);
289                         return ;
290                 }
291
292                 if ( nCount == 0 )
293                 {
294                         continue;
295                 }
296
297                 err = face_extract_component(face, NULL, &rects[0], &component);
298
299                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);
300
301                 face_image_destroy(image);
302
303                 free(rects);
304
305                 face_component_destroy(component);
306         }
307
308         err = face_destroy(face);
309
310         fclose(fp);
311 }
312
313
314 static void utc_uix_face_extract_component_negative_02(void)
315 {
316         static const char szFunc[] = "face_extract_component";
317
318         int err;
319
320         face_h face;
321
322     err = face_create(&face);
323
324         char *filename = TESTVIDEO_NAME;
325         int nW = TESTVIDEO_WIDTH;
326         int nH = TESTVIDEO_HEIGHT;
327
328         unsigned char YBuf[nW*nH];
329
330         FILE *fp;
331         int nRead;
332
333         fp = fopen(filename, "rb");
334         if ( fp == NULL )
335         {
336                 tet_printf("Cannot load file. %s", filename);
337                 tet_result(TET_UNRESOLVED);
338                 return;
339         }
340
341         face_image_h image;
342
343         int nCount = 0;
344
345         face_rect_s *rects = NULL;
346         face_component_h component;
347
348         int i;
349
350         for ( i = 0; i < TESTVIDEO_FRAME; i++)
351         {
352                 nRead = fread (YBuf, 1, nW * nH, fp );
353
354                 if ( nRead != nW * nH )
355                 {
356                         // Error
357                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
358                         tet_result(TET_UNRESOLVED);
359                         return ;
360                 }
361
362                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf, nW, nH, nW * nH, &image);
363
364                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, image, &rects, &nCount );
365
366                 if ( err != FACE_ERROR_NONE )
367                 {
368                         tet_printf("[F:%20s L%4d] Detect face Error! err=%d\n", __FUNCTION__, __LINE__, err);
369                         tet_result(TET_UNRESOLVED);
370                         return ;
371                 }
372
373                 if ( nCount == 0 )
374                 {
375                         continue;
376                 }
377
378                 err = face_extract_component(face, image, NULL, &component);
379
380                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);
381
382                 face_image_destroy(image);
383
384                 free(rects);
385
386                 face_component_destroy(component);
387         }
388
389         err = face_destroy(face);
390
391         fclose(fp);
392 }
393
394
395
396 static void utc_uix_face_extract_component_negative_03(void)
397 {
398         static const char szFunc[] = "face_extract_component";
399
400         int err;
401
402         face_h face;
403
404     err = face_create(&face);
405
406         char *filename = TESTVIDEO_NAME;
407         int nW = TESTVIDEO_WIDTH;
408         int nH = TESTVIDEO_HEIGHT;
409
410         unsigned char YBuf[nW*nH];
411
412         FILE *fp;
413         int nRead;
414
415         fp = fopen(filename, "rb");
416         if ( fp == NULL )
417         {
418                 tet_printf("Cannot load file. %s", filename);
419                 tet_result(TET_UNRESOLVED);
420                 return;
421         }
422
423         face_image_h image;
424
425         int nCount = 0;
426
427         face_rect_s *rects = NULL;
428         face_component_h component;
429
430         int i;
431
432         for ( i = 0; i < TESTVIDEO_FRAME; i++)
433         {
434                 nRead = fread (YBuf, 1, nW * nH, fp );
435
436                 if ( nRead != nW * nH )
437                 {
438                         // Error
439                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
440                         tet_result(TET_UNRESOLVED);
441                         return ;
442                 }
443
444                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf, nW, nH, nW * nH, &image);
445
446                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, image, &rects, &nCount );
447
448                 if ( err != FACE_ERROR_NONE )
449                 {
450                         tet_printf("[F:%20s L%4d] Detect face Error! err=%d\n", __FUNCTION__, __LINE__, err);
451                         tet_result(TET_UNRESOLVED);
452                         return ;
453                 }
454
455                 if ( nCount == 0 )
456                 {
457                         continue;
458                 }
459
460                 err = face_extract_component(face, NULL, &rects[0], &component);
461
462                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);
463
464                 face_image_destroy(image);
465
466                 free(rects);
467
468                 face_component_destroy(component);
469         }
470
471         err = face_destroy(face);
472
473         fclose(fp);
474 }
475
476
477 static void utc_uix_face_extract_component_negative_04(void)
478 {
479         static const char szFunc[] = "face_extract_component";
480
481         int err;
482
483         face_h face;
484
485     err = face_create(&face);
486
487         char *filename = TESTVIDEO_NAME;
488         int nW = TESTVIDEO_WIDTH;
489         int nH = TESTVIDEO_HEIGHT;
490
491         unsigned char YBuf[nW*nH];
492
493         FILE *fp;
494         int nRead;
495
496         fp = fopen(filename, "rb");
497         if ( fp == NULL )
498         {
499                 tet_printf("Cannot load file. %s", filename);
500                 tet_result(TET_UNRESOLVED);
501                 return;
502         }
503
504         face_image_h image;
505
506         int nCount = 0;
507
508         face_rect_s *rects = NULL;
509         face_component_h component;
510
511         int i;
512
513         for ( i = 0; i < TESTVIDEO_FRAME; i++)
514         {
515                 nRead = fread (YBuf, 1, nW * nH, fp );
516
517                 if ( nRead != nW * nH )
518                 {
519                         // Error
520                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
521                         tet_result(TET_UNRESOLVED);
522                         return ;
523                 }
524
525                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf, nW, nH, nW * nH, &image);
526
527                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, image, &rects, &nCount );
528
529                 if ( err != FACE_ERROR_NONE )
530                 {
531                         tet_printf("[F:%20s L%4d] Detect face Error! err=%d\n", __FUNCTION__, __LINE__, err);
532                         tet_result(TET_UNRESOLVED);
533                         return ;
534                 }
535
536                 if ( nCount == 0 )
537                 {
538                         continue;
539                 }
540
541                 err = face_extract_component(face, image, &rects[0], NULL);
542
543                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);
544
545                 face_image_destroy(image);
546
547                 free(rects);
548
549                 face_component_destroy(component);
550         }
551
552         err = face_destroy(face);
553
554         fclose(fp);
555 }
556
557 static void utc_uix_face_extract_feature_negative_01(void)
558 {
559         static const char szFunc[] = "face_extract_feature";
560
561         int err;
562
563         face_h face;
564
565     err = face_create(&face);
566
567         char *filename = TESTVIDEO_NAME;
568         int nW = TESTVIDEO_WIDTH;
569         int nH = TESTVIDEO_HEIGHT;
570
571         unsigned char YBuf[nW*nH];
572
573         FILE *fp;
574         int nRead;
575
576         fp = fopen(filename, "rb");
577         if ( fp == NULL )
578         {
579                 tet_printf("Cannot load file. %s", filename);
580                 tet_result(TET_UNRESOLVED);
581                 return;
582         }
583
584         face_image_h image;
585
586         int nCount = 0;
587
588         face_rect_s *rects = NULL;
589         face_component_h component;
590         face_feature_h feature;
591
592         int i;
593
594         for ( i = 0; i < TESTVIDEO_FRAME; i++)
595         {
596                 nRead = fread (YBuf, 1, nW * nH, fp );
597
598                 if ( nRead != nW * nH )
599                 {
600                         // Error
601                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
602                         tet_result(TET_UNRESOLVED);
603                         return ;
604                 }
605
606                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf, nW, nH, nW * nH, &image);
607
608                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, image, &rects, &nCount );
609
610                 if ( err != FACE_ERROR_NONE )
611                 {
612                         tet_printf("[F:%20s L%4d] Detect face Error! err=%d\n", __FUNCTION__, __LINE__, err);
613                         tet_result(TET_UNRESOLVED);
614                         return ;
615                 }
616
617                 if ( nCount == 0 )
618                 {
619                         continue;
620                 }
621
622                 err = face_extract_component(face, image, &rects[0], &component);
623
624                 err = face_extract_feature(face, image, NULL, &feature);
625
626                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);             // Face feature func does not support continous frame
627
628                 free(rects);
629
630                 face_image_destroy(image);
631
632                 face_component_destroy(component);
633
634                 if ( feature != NULL ) face_feature_destroy(feature);
635         }
636
637         err = face_destroy(face);
638
639         fclose(fp);
640
641 }
642
643
644 static void utc_uix_face_recognize_blink_negative_01(void)
645 {
646         static const char szFunc[] = "face_recognize_blink";
647
648         int err;
649
650         face_h face;
651
652     err = face_create(&face);
653
654         char *filename = TESTVIDEO_NAME;
655         int nW = TESTVIDEO_WIDTH;
656         int nH = TESTVIDEO_HEIGHT;
657
658         unsigned char YBuf[nW*nH];
659
660         FILE *fp;
661         int nRead;
662
663         fp = fopen(filename, "rb");
664         if ( fp == NULL )
665         {
666                 tet_printf("Cannot load file. %s", filename);
667                 tet_result(TET_UNRESOLVED);
668                 return;
669         }
670
671         face_image_h image;
672
673         int nCount = 0;
674
675         face_rect_s *rects = NULL;
676         face_component_h component;
677         face_eye_state_e lefteye, righteye;
678
679         int i;
680
681         for ( i = 0; i < TESTVIDEO_FRAME; i++)
682         {
683                 nRead = fread (YBuf, 1, nW * nH, fp );
684
685                 if ( nRead != nW * nH )
686                 {
687                         // Error
688                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
689                         tet_result(TET_UNRESOLVED);
690                         return ;
691                 }
692
693                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf, nW, nH, nW * nH, &image);
694
695                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, image, &rects, &nCount );
696
697                 if ( err != FACE_ERROR_NONE )
698                 {
699                         tet_printf("[F:%20s L%4d] Detect face Error! err=%d\n", __FUNCTION__, __LINE__, err);
700                         tet_result(TET_UNRESOLVED);
701                         return ;
702                 }
703
704                 if ( nCount == 0 )
705                 {
706                         continue;
707                 }
708
709                 err = face_extract_component(face, image, &rects[0], &component);
710
711                 err = face_recognize_blink(face, NULL, component, &lefteye,  &righteye);
712
713                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);
714
715                 face_image_destroy(image);
716
717                 free(rects);
718                 face_component_destroy(component);
719
720         }
721
722         err = face_destroy(face);
723
724         fclose(fp);
725
726 }
727
728 static void utc_uix_face_recognize_expression_negative_01(void)
729 {
730         static const char szFunc[] = "face_recognize_expression";
731
732         int err;
733
734         face_h face;
735
736     err = face_create(&face);
737
738         char *filename = TESTVIDEO_NAME;
739         int nW = TESTVIDEO_WIDTH;
740         int nH = TESTVIDEO_HEIGHT;
741
742         unsigned char YBuf[nW*nH];
743
744         FILE *fp;
745         int nRead;
746
747         fp = fopen(filename, "rb");
748         if ( fp == NULL )
749         {
750                 tet_printf("Cannot load file. %s", filename);
751                 tet_result(TET_UNRESOLVED);
752                 return;
753         }
754
755         face_image_h image;
756
757         int nCount = 0;
758
759         face_rect_s *rects = NULL;
760         face_component_h component;
761         face_expression_e expr;
762
763         int i;
764
765         for ( i = 0; i < TESTVIDEO_FRAME; i++)
766         {
767                 nRead = fread (YBuf, 1, nW * nH, fp );
768
769                 if ( nRead != nW * nH )
770                 {
771                         // Error
772                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
773                         tet_result(TET_UNRESOLVED);
774                         return ;
775                 }
776
777                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf, nW, nH, nW * nH, &image);
778
779                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, image, &rects, &nCount );
780
781                 if ( err != FACE_ERROR_NONE )
782                 {
783                         tet_printf("[F:%20s L%4d] Detect face Error! err=%d\n", __FUNCTION__, __LINE__, err);
784                         tet_result(TET_UNRESOLVED);
785                         return ;
786                 }
787
788                 if ( nCount == 0 )
789                 {
790                         continue;
791                 }
792
793                 err = face_extract_component(face, image, &rects[0], &component);
794
795                 err = face_recognize_expression(face, image, NULL, &expr);
796
797                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);
798
799                 face_image_destroy(image);
800
801                 free(rects);
802                 face_component_destroy(component);
803         }
804
805         err = face_destroy(face);
806
807         fclose(fp);
808
809 }
810
811 static void utc_uix_face_get_movement_negative_01(void)
812 {
813         static const char szFunc[] = "face_get_movement";
814
815         int err;
816
817         face_h face;
818
819     err = face_create(&face);
820
821         char *filename = TESTVIDEO_NAME;
822         int nW = TESTVIDEO_WIDTH;
823         int nH = TESTVIDEO_HEIGHT;
824
825         unsigned char YBuf[2][TESTVIDEO_WIDTH*TESTVIDEO_HEIGHT];
826
827         FILE *fp;
828         int nRead;
829
830         fp = fopen(filename, "rb");
831         if ( fp == NULL )
832         {
833                 tet_printf("Cannot load file. %s", filename);
834                 tet_result(TET_UNRESOLVED);
835                 return;
836         }
837
838         face_image_h image;
839         face_image_h prev_image;
840
841         int nCount = 0;
842
843         face_rect_s *rects = NULL;
844
845         face_rect_s prev_rect;
846         face_rect_s cur_rect;
847
848         int i;
849
850         for ( i = 0; i < TESTVIDEO_FRAME; i++)
851         {
852                 nRead = fread (YBuf[i%2], 1, nW * nH, fp );
853
854                 if ( nRead != nW * nH )
855                 {
856                         // Error
857                         tet_printf("Wanted %d bytes Read %d bytes\n", nW * nH, nRead);
858                         tet_result(TET_UNRESOLVED);
859                         fclose(fp);
860                         return ;
861                 }
862
863                 face_image_create(FACE_IMAGE_COLORSPACE_LUMINANCE_ONLY, YBuf[i%2], nW, nH, nW * nH, &image);
864
865                 err = face_detect_faces(face, FACE_IMAGE_TYPE_CONTINIOUS, image, &rects, &nCount );
866
867                 if ( err != FACE_ERROR_NONE )
868                 {
869                         tet_printf("[F:%20s L%4d] Detect face Error! err=%d\n", __FUNCTION__, __LINE__, err);
870                         tet_result(TET_UNRESOLVED);
871                         fclose(fp);
872                         return ;
873                 }
874
875                 if ( nCount == 0 )
876                 {
877                         // rects is NULL when count is 0
878                         continue;
879                 }
880
881                 if ( i == 0 )
882                 {
883                         prev_image = image;
884                         prev_rect = rects[0];
885
886                         free(rects);
887                         continue;       // Skip first frame
888                 }
889
890                 err = face_get_movement(face, prev_image, NULL, NULL, &cur_rect);
891
892                 dts_check_ne(szFunc, err, FACE_ERROR_NONE);
893
894                 face_image_destroy(prev_image);
895
896                 prev_rect = rects[0];
897                 prev_image = image;
898
899                 free(rects);
900         }
901
902         err = face_destroy(face);
903
904         fclose(fp);
905
906 }
907
908
909 struct tet_testlist tet_testlist[] = {
910     { utc_uix_face_detect_faces_from_video_stream_negative_01, 1},
911         { utc_uix_face_detect_faces_from_video_stream_negative_02, 1},
912     { utc_uix_face_detect_faces_from_video_stream_negative_03, 1},
913     { utc_uix_face_extract_component_negative_01, 2},
914     { utc_uix_face_extract_component_negative_02, 2},
915     { utc_uix_face_extract_component_negative_03, 2},
916     { utc_uix_face_extract_component_negative_04, 2},
917     { utc_uix_face_extract_feature_negative_01, 3},
918     { utc_uix_face_recognize_blink_negative_01, 4},
919     { utc_uix_face_recognize_expression_negative_01, 5},
920         { utc_uix_face_get_movement_negative_01, 6},
921         { NULL, 0},
922 };
923