• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 Copyright (c) 2012, 2016, The Linux Foundation. All rights reserved.
3 
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are
6 met:
7     * Redistributions of source code must retain the above copyright
8       notice, this list of conditions and the following disclaimer.
9     * Redistributions in binary form must reproduce the above
10       copyright notice, this list of conditions and the following
11       disclaimer in the documentation and/or other materials provided
12       with the distribution.
13     * Neither the name of The Linux Foundation nor the names of its
14       contributors may be used to endorse or promote products derived
15       from this software without specific prior written permission.
16 
17 THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20 ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29 
30 // System dependencies
31 #include <pthread.h>
32 
33 // Camera dependencies
34 #include "mm_qcamera_unit_test.h"
35 #include "mm_camera_dbg.h"
36 
37 #define MM_QCAMERA_APP_UTEST_MAX_MAIN_LOOP 4
38 #define MM_QCAM_APP_TEST_NUM 128
39 
40 #define MM_QCAMERA_APP_WAIT_TIME 1000000000
41 
42 extern int system_dimension_set(int cam_id);
43 extern int stopPreview(int cam_id);
44 extern int takePicture_yuv(int cam_id);
45 extern int takePicture_rdi(int cam_id);
46 extern int startRdi(int cam_id);
47 extern int stopRdi(int cam_id);
48 extern int startStats(int cam_id);
49 extern int stopStats(int cam_id);
50 
51 
52 /*
53 * 1. open back
54 * 2. open front
55 * 3. start back
56 * 4. start front
57 * 5. stop back
58 * 6. stop front
59 * 7. close back
60 * 8. close front
61 * 9. take picture
62 * a. start recording
63 * b. stop recording
64 * c. take picture rdi
65 */
66 static mm_app_tc_t mm_app_tc[MM_QCAM_APP_TEST_NUM];
67 static int num_test_cases = 0;
68 struct test_case_params {
69   uint16_t launch;
70   uint16_t preview;
71   uint16_t recording;
72   uint16_t snapshot;
73 };
74 
75 /*  Test case 12436857 :*/
76 
mm_app_dtc_0(mm_camera_app_t * cam_apps)77 int mm_app_dtc_0(mm_camera_app_t *cam_apps)
78 {
79         int rc = MM_CAMERA_OK;
80         int i,j;
81         int result = 0;
82         int front_camera = 1;
83         int back_camera = 0;
84 
85         printf("\n Verifying Preview on back Camera and RDI on Front camera 0...\n");
86         LOGE("DUAL open back camera \n");
87         if(mm_app_open(back_camera) != MM_CAMERA_OK) {
88                 LOGE("mm_app_open() back camera err=%d\n", rc);
89                 rc = -1;
90                 goto end;
91         }
92         if(system_dimension_set(back_camera) != MM_CAMERA_OK){
93                 LOGE("system_dimension_set() err=%d\n", rc);
94                 rc = -1;
95                 goto end;
96         }
97 
98         LOGE("DUAL open front camera \n");
99         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
100                 LOGE("mm_app_open() front camera err=%d\n", rc);
101                 rc = -1;
102                 goto end;
103         }
104 
105         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
106                 LOGE("system_dimension_set() err=%d\n", rc);
107                 rc = -1;
108                 goto end;
109         }
110 
111         LOGE("DUAL start camera Rdi for front \n");
112         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
113                LOGE(" back camera startPreview() err=%d\n",  rc);
114                 goto end;
115         }
116         mm_camera_app_wait();
117         sleep(1);
118 
119         LOGE("DUAL start camera Preview for back \n");
120         if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
121                 LOGE(" startPreview() backcamera err=%d\n",  rc);
122                 goto end;
123         }
124         mm_camera_app_wait();
125         sleep(1);
126 
127         LOGE("DUAL stop camera Rdi for front \n");
128         if( MM_CAMERA_OK != (rc = stopRdi(front_camera))) {
129                 LOGE(" startPreview() backcamera err=%d\n",  rc);
130                 goto end;
131         }
132         usleep(10*1000);
133 
134         LOGE("DUAL close front camera\n");
135         if( mm_app_close(front_camera) != MM_CAMERA_OK) {
136                 LOGE("mm_app_close() err=%d\n", rc);
137                 rc = -1;
138                 goto end;
139         }
140         sleep(1);
141         LOGE("DUAL stop camera Preview for back \n");
142         if( MM_CAMERA_OK != (rc = stopPreview(back_camera))) {
143                 LOGD(" startPreview() err=%d\n",  rc);
144                 goto end;
145         }
146         usleep(10*1000);
147         LOGE("DUAL close back camera \n");
148         if( mm_app_close(back_camera) != MM_CAMERA_OK) {
149                 LOGE("mm_app_close() err=%d\n", rc);
150                 rc = -1;
151                 goto end;
152         }
153         LOGE("DUAL end \n");
154 
155 end:
156         if(rc == 0) {
157                 printf("\nPassed\n");
158         }else{
159                 printf("\nFailed\n");
160         }
161         LOGD("END, rc = %d\n",  rc);
162         return rc;
163 }
164 
165 /*  Test case 12436587 :*/
166 
mm_app_dtc_1(mm_camera_app_t * cam_apps)167 int mm_app_dtc_1(mm_camera_app_t *cam_apps)
168 {
169         int rc = MM_CAMERA_OK;
170         int i,j;
171         int result = 0;
172         int front_camera = 1;
173         int back_camera = 0;
174 
175         printf("\n Verifying Preview on back Camera and RDI on Front camera 1...\n");
176         LOGE("DUAL open back camera \n");
177         if(mm_app_open(back_camera) != MM_CAMERA_OK) {
178                 LOGE("mm_app_open() back camera err=%d\n", rc);
179                 rc = -1;
180                 goto end;
181         }
182         if(system_dimension_set(back_camera) != MM_CAMERA_OK){
183                 LOGE("system_dimension_set() err=%d\n", rc);
184                 rc = -1;
185                 goto end;
186         }
187 
188         LOGE("DUAL open front camera \n");
189         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
190                 LOGE("mm_app_open() front camera err=%d\n", rc);
191                 rc = -1;
192                 goto end;
193         }
194 
195         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
196                 LOGE("system_dimension_set() err=%d\n", rc);
197                 rc = -1;
198                 goto end;
199         }
200 
201         LOGE("DUAL start camera Rdi for front \n");
202         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
203                LOGE(" back camera startPreview() err=%d\n",  rc);
204                 goto end;
205         }
206         mm_camera_app_wait();
207         sleep(1);
208 
209         LOGE("DUAL start camera Preview for back \n");
210 
211         if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
212                 LOGE(" startPreview() backcamera err=%d\n",  rc);
213                 goto end;
214         }
215         mm_camera_app_wait();
216         sleep(1);
217         LOGE("DUAL end \n");
218 
219         LOGE("DUAL stop camera Preview for front \n");
220         if( MM_CAMERA_OK != (rc = stopRdi(front_camera))) {
221                 LOGE(" startPreview() backcamera err=%d\n",  rc);
222                 goto end;
223         }
224         usleep(10*1000);
225         LOGE("DUAL stop camera Preview for back \n");
226         if( MM_CAMERA_OK != (rc = stopPreview(back_camera))) {
227                 LOGD(" startPreview() err=%d\n",  rc);
228                 goto end;
229         }
230         usleep(10*1000);
231         LOGE("DUAL close front camera\n");
232         if( mm_app_close(front_camera) != MM_CAMERA_OK) {
233                 LOGE("mm_app_close() err=%d\n", rc);
234                 rc = -1;
235                 goto end;
236         }
237         LOGE("DUAL close back camera \n");
238         if( mm_app_close(back_camera) != MM_CAMERA_OK) {
239                 LOGE("mm_app_close() err=%d\n", rc);
240                 rc = -1;
241                 goto end;
242         }
243 
244 end:
245         if(rc == 0) {
246                 printf("\nPassed\n");
247         }else{
248                 printf("\nFailed\n");
249         }
250         LOGD("END, rc = %d\n",  rc);
251         return rc;
252 }
253 
254 /*  Test case 12436578 :*/
255 
mm_app_dtc_2(mm_camera_app_t * cam_apps)256 int mm_app_dtc_2(mm_camera_app_t *cam_apps)
257 {
258         int rc = MM_CAMERA_OK;
259         int i,j;
260         int result = 0;
261         int front_camera = 1;
262         int back_camera = 0;
263 
264         printf("\n Verifying Preview on back Camera and RDI on Front camera 2...\n");
265         LOGE("DUAL open back camera \n");
266         if(mm_app_open(back_camera) != MM_CAMERA_OK) {
267                 LOGE("mm_app_open() back camera err=%d\n", rc);
268                 rc = -1;
269                 goto end;
270         }
271         if(system_dimension_set(back_camera) != MM_CAMERA_OK){
272                 LOGE("system_dimension_set() err=%d\n", rc);
273                 rc = -1;
274                 goto end;
275         }
276 
277         LOGE("DUAL open front camera \n");
278         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
279                 LOGE("mm_app_open() front camera err=%d\n", rc);
280                 rc = -1;
281                 goto end;
282         }
283 
284         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
285                 LOGE("system_dimension_set() err=%d\n", rc);
286                 rc = -1;
287                 goto end;
288         }
289 
290         LOGE("DUAL start camera Rdi for front \n");
291         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
292                LOGE(" back camera startPreview() err=%d\n",  rc);
293                 goto end;
294         }
295         mm_camera_app_wait();
296         sleep(1);
297 
298         LOGE("DUAL start camera Preview for back \n");
299 
300         if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
301                 LOGE(" startPreview() backcamera err=%d\n",  rc);
302                 goto end;
303         }
304         mm_camera_app_wait();
305         sleep(1);
306         LOGE("DUAL end \n");
307 
308         LOGE("DUAL stop camera Preview for front \n");
309         if( MM_CAMERA_OK != (rc = stopRdi(front_camera))) {
310                 LOGE(" startPreview() backcamera err=%d\n",  rc);
311                 goto end;
312         }
313         usleep(10*1000);
314         LOGE("DUAL stop camera Preview for back \n");
315         if( MM_CAMERA_OK != (rc = stopPreview(back_camera))) {
316                 LOGD(" startPreview() err=%d\n",  rc);
317                 goto end;
318         }
319         usleep(10*1000);
320         LOGE("DUAL close back camera \n");
321         if( mm_app_close(back_camera) != MM_CAMERA_OK) {
322                 LOGE("mm_app_close() err=%d\n", rc);
323                 rc = -1;
324                 goto end;
325         }
326         LOGE("DUAL close front camera\n");
327         if( mm_app_close(front_camera) != MM_CAMERA_OK) {
328                 LOGE("mm_app_close() err=%d\n", rc);
329                 rc = -1;
330                 goto end;
331         }
332 
333 end:
334         if(rc == 0) {
335                 printf("\nPassed\n");
336         }else{
337                 printf("\nFailed\n");
338         }
339         LOGD("END, rc = %d\n",  rc);
340         return rc;
341 }
342 
343 /*  Test case 241395768 : 1357 * 3, This is performed three times
344 * And for each iteration 9 is performed thrice */
345 
mm_app_dtc_3(mm_camera_app_t * cam_apps)346 int mm_app_dtc_3(mm_camera_app_t *cam_apps)
347 {
348         int rc = MM_CAMERA_OK;
349         int i,j,k;
350         int result = 0;
351         int front_camera = 1;
352         int back_camera = 0;
353 
354         printf("\n Verifying Preview and snapshot on back Camera and RDI on Front camera 3...\n");
355         LOGE("DUAL open front camera \n");
356         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
357                 LOGE("mm_app_open() front camera err=%d\n", rc);
358                 rc = -1;
359                 goto end;
360         }
361         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
362                 LOGE("system_dimension_set() err=%d\n", rc);
363                 rc = -1;
364                 goto end;
365         }
366 
367         LOGE("DUAL start camera Preview for front \n");
368 
369         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
370                 LOGE(" startPreview() frontcamera err=%d\n",  rc);
371                 goto end;
372         }
373         mm_camera_app_wait();
374         usleep(10*1000);
375 
376         for (k = 0; k < MM_QCAMERA_APP_INTERATION ; k++) {
377           LOGE("DUAL open back camera %d \n",k);
378           if(mm_app_open(back_camera) != MM_CAMERA_OK) {
379                   LOGE("mm_app_open() back camera err=%d\n", rc);
380                   rc = -1;
381                   goto end;
382           }
383 
384           if(system_dimension_set(back_camera) != MM_CAMERA_OK){
385                   LOGE("system_dimension_set() err=%d\n", rc);
386                   rc = -1;
387                   goto end;
388           }
389 
390           LOGE("DUAL start camera Preview for back \n");
391           if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
392                  LOGE(" back camera startPreview() err=%d\n",  rc);
393                   goto end;
394           }
395 
396           for (j = 0; j < MM_QCAMERA_APP_INTERATION; j++) {
397               LOGE("DUAL take picture for back \n");
398               if ( MM_CAMERA_OK != (rc = takePicture_yuv(back_camera))) {
399                   LOGE(" TakePicture() err=%d\n",  rc);
400                   break;
401               }
402               mm_camera_app_wait();
403 
404           }
405           usleep(10*1000);
406           LOGE("DUAL stop camera Preview for back \n");
407           if( MM_CAMERA_OK != (rc = stopPreview(back_camera))) {
408                   LOGE(" stopPreview() backcamera err=%d\n",  rc);
409                   goto end;
410           }
411           usleep(10*1000);
412 
413           LOGE("DUAL close back camera\n");
414           if( mm_app_close(back_camera) != MM_CAMERA_OK) {
415                   LOGE("mm_app_close() err=%d\n", rc);
416                   rc = -1;
417                   goto end;
418           }
419           usleep(20*1000);
420         }
421         LOGE("DUAL stop camera Preview for Rdi \n");
422         if( MM_CAMERA_OK != (rc = stopRdi(front_camera))) {
423                 LOGD(" stopRdi() err=%d\n",  rc);
424                 goto end;
425         }
426         usleep(10*1000);
427         LOGE("DUAL close front camera \n");
428         if( mm_app_close(front_camera) != MM_CAMERA_OK) {
429                 LOGE("mm_app_close() err=%d\n", rc);
430                 rc = -1;
431                 goto end;
432         }
433         LOGE("DUAL end \n");
434 
435 end:
436         if(rc == 0) {
437                 printf("\nPassed\n");
438         }else{
439                 printf("\nFailed\n");
440         }
441         LOGD("END, rc = %d\n",  rc);
442         return rc;
443 }
444 
445 /*  Test case 2413ab5768 : 1357 * 3, This is performed three times
446 * And for each iteration ab is performed thrice */
447 
mm_app_dtc_4(mm_camera_app_t * cam_apps)448 int mm_app_dtc_4(mm_camera_app_t *cam_apps)
449 {
450         int rc = MM_CAMERA_OK;
451         int i,j,k;
452         int result = 0;
453         int front_camera = 1;
454         int back_camera = 0;
455 
456         printf("\n Verifying Preview on back Camera and RDI on Front camera 4...\n");
457         LOGE("DUAL open front camera \n");
458         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
459                 LOGE("mm_app_open() front camera err=%d\n", rc);
460                 rc = -1;
461                 goto end;
462         }
463         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
464                 LOGE("system_dimension_set() err=%d\n", rc);
465                 rc = -1;
466                 goto end;
467         }
468 
469         LOGE("DUAL start camera Preview for front \n");
470 
471         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
472                 LOGE(" startPreview() frontcamera err=%d\n",  rc);
473                 goto end;
474         }
475         mm_camera_app_wait();
476         usleep(20*1000);
477 
478         for (k = 0; k < MM_QCAMERA_APP_INTERATION ; k++){
479           LOGE("DUAL open back camera %d \n",k);
480           if(mm_app_open(back_camera) != MM_CAMERA_OK) {
481                  LOGE("mm_app_open() back camera err=%d\n", rc);
482                  rc = -1;
483                  goto end;
484           }
485 
486           if(system_dimension_set(back_camera) != MM_CAMERA_OK){
487                  LOGE("system_dimension_set() err=%d\n", rc);
488                  rc = -1;
489                  goto end;
490           }
491 
492           LOGE("DUAL start camera Preview for back \n");
493           if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
494                 LOGE(" back camera startPreview() err=%d\n",  rc);
495                  goto end;
496           }
497           usleep(30*1000);
498 
499           for (j = 0; j < MM_QCAMERA_APP_INTERATION; j++) {
500              LOGE("DUAL start camera record for back \n");
501              if ( MM_CAMERA_OK != (rc = startRecording(back_camera))) {
502                  LOGE(" StartVideorecording() err=%d\n",  rc);
503                  break;
504              }
505 
506              mm_camera_app_wait();
507              usleep(15*1000);
508              LOGE("DUAL stop camera record for back \n");
509              if ( MM_CAMERA_OK != (rc = stopRecording(back_camera))) {
510                  LOGE(" Stopvideorecording() err=%d\n",  rc);
511                  break;
512              }
513           }
514           usleep(10*1000);
515 
516           LOGE("DUAL stop camera Preview for back \n");
517           if( MM_CAMERA_OK != (rc = stopPreview(back_camera))) {
518                  LOGE(" stopPreview() backcamera err=%d\n",  rc);
519                  goto end;
520           }
521           usleep(10*1000);
522 
523           LOGE("DUAL close back camera\n");
524           if( mm_app_close(back_camera) != MM_CAMERA_OK) {
525                  LOGE("mm_app_close() err=%d\n", rc);
526                  rc = -1;
527                  goto end;
528           }
529           usleep(20*1000);
530         }
531         LOGE("DUAL stop camera Preview for Rdi \n");
532         if( MM_CAMERA_OK != (rc = stopRdi(front_camera))) {
533                 LOGD(" stopRdi() err=%d\n",  rc);
534                 goto end;
535         }
536         usleep(10*1000);
537         LOGE("DUAL close front camera \n");
538         if( mm_app_close(front_camera) != MM_CAMERA_OK) {
539                 LOGE("mm_app_close() err=%d\n", rc);
540                 rc = -1;
541                 goto end;
542         }
543         LOGE("DUAL end \n");
544 
545 end:
546         if(rc == 0) {
547                 printf("\nPassed\n");
548         }else{
549                 printf("\nFailed\n");
550         }
551         LOGD("END, rc = %d\n",  rc);
552         return rc;
553 }
554 
555 /*  Test case 24135768 : 1357 * 3, This is performed three times*/
556 
mm_app_dtc_5(mm_camera_app_t * cam_apps)557 int mm_app_dtc_5(mm_camera_app_t *cam_apps)
558 {
559         int rc = MM_CAMERA_OK;
560         int i,j,k;
561         int result = 0;
562         int front_camera = 1;
563         int back_camera = 0;
564 
565         printf("\n Verifying Preview on back Camera and RDI on Front camera 5...\n");
566         LOGE("DUAL open front camera \n");
567         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
568                 LOGE("mm_app_open() front camera err=%d\n", rc);
569                 rc = -1;
570                 goto end;
571         }
572         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
573                 LOGE("system_dimension_set() err=%d\n", rc);
574                 rc = -1;
575                 goto end;
576         }
577 
578         LOGE("DUAL start camera Preview for front \n");
579 
580         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
581                 LOGE(" startPreview() frontcamera err=%d\n",  rc);
582                 goto end;
583         }
584         mm_camera_app_wait();
585         sleep(1);
586 
587         for (k = 0; k < 4 ; k++) {
588           LOGE("DUAL open back camera %d \n",k);
589           if(mm_app_open(back_camera) != MM_CAMERA_OK) {
590                   LOGE("mm_app_open() back camera err=%d\n", rc);
591                   rc = -1;
592                   goto end;
593           }
594 
595           if(system_dimension_set(back_camera) != MM_CAMERA_OK){
596                   LOGE("system_dimension_set() err=%d\n", rc);
597                   rc = -1;
598                   goto end;
599           }
600 
601           LOGE("DUAL start camera Preview for back \n");
602           if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
603                  LOGE(" back camera startPreview() err=%d\n",  rc);
604                   goto end;
605           }
606           mm_camera_app_wait();
607           sleep(1);
608 
609           LOGE("DUAL stop camera Preview for back \n");
610           if( MM_CAMERA_OK != (rc = stopPreview(back_camera))) {
611                   LOGE(" stopPreview() backcamera err=%d\n",  rc);
612                   goto end;
613           }
614           usleep(10*1000);
615 
616           LOGE("DUAL close back camera\n");
617           if( mm_app_close(back_camera) != MM_CAMERA_OK) {
618                   LOGE("mm_app_close() err=%d\n", rc);
619                   rc = -1;
620                   goto end;
621           }
622           sleep(1);
623         }
624         LOGE("DUAL stop camera Preview for Rdi \n");
625         if( MM_CAMERA_OK != (rc = stopRdi(front_camera))) {
626                 LOGD(" stopRdi() err=%d\n",  rc);
627                 goto end;
628         }
629         usleep(10*1000);
630         LOGE("DUAL close front camera \n");
631         if( mm_app_close(front_camera) != MM_CAMERA_OK) {
632                 LOGE("mm_app_close() err=%d\n", rc);
633                 rc = -1;
634                 goto end;
635         }
636         LOGE("DUAL end \n");
637 
638 end:
639         if(rc == 0) {
640                 printf("\nPassed\n");
641         }else{
642                 printf("\nFailed\n");
643         }
644         LOGD("END, rc = %d\n",  rc);
645         return rc;
646 }
647 
648 /*  Test case 13246857 : 2468 * 3, This is performed three times*/
649 
mm_app_dtc_6(mm_camera_app_t * cam_apps)650 int mm_app_dtc_6(mm_camera_app_t *cam_apps)
651 {
652         int rc = MM_CAMERA_OK;
653         int i,j,k;
654         int result = 0;
655         int front_camera = 1;
656         int back_camera = 0;
657 
658         printf("\n Verifying Preview on back Camera and RDI on Front camera 6...\n");
659         LOGE("DUAL open back camera \n");
660         if(mm_app_open(back_camera) != MM_CAMERA_OK) {
661                 LOGE("mm_app_open() back camera err=%d\n", rc);
662                 rc = -1;
663                 goto end;
664         }
665         if(system_dimension_set(back_camera) != MM_CAMERA_OK){
666                 LOGE("system_dimension_set() err=%d\n", rc);
667                 rc = -1;
668                 goto end;
669         }
670 
671         LOGE("DUAL start camera Preview for back \n");
672 
673         if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
674                 LOGE(" startPreview() backcamera err=%d\n",  rc);
675                 goto end;
676         }
677         mm_camera_app_wait();
678         sleep(1);
679 
680         for (k = 0; k < 4 ; k++) {
681         LOGE("DUAL open front camera %d \n",k);
682         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
683                 LOGE("mm_app_open() front camera err=%d\n", rc);
684                 rc = -1;
685                 goto end;
686         }
687 
688         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
689                 LOGE("system_dimension_set() err=%d\n", rc);
690                 rc = -1;
691                 goto end;
692         }
693 
694         LOGE("DUAL start camera Rdi for front \n");
695         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
696                LOGE(" back camera startPreview() err=%d\n",  rc);
697                 goto end;
698         }
699         mm_camera_app_wait();
700         sleep(1);
701 
702         LOGE("DUAL stop camera Preview for front \n");
703         if( MM_CAMERA_OK != (rc = stopRdi(front_camera))) {
704                 LOGE(" startPreview() backcamera err=%d\n",  rc);
705                 goto end;
706         }
707         usleep(10*1000);
708 
709         LOGE("DUAL close front camera\n");
710         if( mm_app_close(front_camera) != MM_CAMERA_OK) {
711                 LOGE("mm_app_close() err=%d\n", rc);
712                 rc = -1;
713                 goto end;
714         }
715         sleep(1);
716         }
717         LOGE("DUAL stop camera Preview for back \n");
718         if( MM_CAMERA_OK != (rc = stopPreview(back_camera))) {
719                 LOGD(" startPreview() err=%d\n",  rc);
720                 goto end;
721         }
722         usleep(10*1000);
723         LOGE("DUAL close back camera \n");
724         if( mm_app_close(back_camera) != MM_CAMERA_OK) {
725                 LOGE("mm_app_close() err=%d\n", rc);
726                 rc = -1;
727                 goto end;
728         }
729         LOGE("DUAL end \n");
730 
731 end:
732         if(rc == 0) {
733                 printf("\nPassed\n");
734         }else{
735                 printf("\nFailed\n");
736         }
737         LOGD("END, rc = %d\n",  rc);
738         return rc;
739 }
740 
741 /*Multi Threaded Test Cases*/
front_thread(void * data)742 static void *front_thread(void *data)
743 {
744         int front_camera = 1;
745         int rc = MM_CAMERA_OK;
746         int i,j,k,m;
747         struct test_case_params params
748           = *((struct test_case_params *)data);
749         for (i = 0; i < params.launch; i++) {
750           LOGE("DUAL open front camera %d\n",i);
751           if(mm_app_open(front_camera) != MM_CAMERA_OK) {
752             LOGE("mm_app_open() front camera err=%d\n", rc);
753             rc = -1;
754             goto end;
755           }
756 
757           if(system_dimension_set(front_camera) != MM_CAMERA_OK){
758             LOGE("system_dimension_set() err=%d\n", rc);
759             rc = -1;
760             goto end;
761           }
762 
763           for (j = 0; j < params.preview; j++) {
764             LOGE("DUAL start camera Rdi for front %d ,%d \n",i,j);
765             if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
766               LOGE(" back camera startPreview() err=%d\n",  rc);
767               goto end;
768             }
769             mm_camera_app_wait();
770             usleep(20*1000);
771             for (k = 0; k < params.snapshot; k++) {
772               LOGE("DUAL take picture for front %d,%d,%d \n",i,j,k);
773               if ( MM_CAMERA_OK != (rc = takePicture_rdi(front_camera))) {
774                 LOGE(" TakePicture() err=%d\n",  rc);
775                 goto end;
776               }
777               mm_camera_app_wait();
778               usleep(30*1000);
779             }
780             LOGE("DUAL stop camera Rdi for front %d,%d\n",i,j);
781             if( MM_CAMERA_OK != (rc = stopRdi(front_camera))) {
782               LOGE(" startPreview() backcamera err=%d\n",  rc);
783               goto end;
784             }
785             usleep(10*1000);
786           }
787 
788           LOGE("DUAL close front camera %d\n",i);
789           if( mm_app_close(front_camera) != MM_CAMERA_OK) {
790             LOGE("mm_app_close() err=%d\n", rc);
791             rc = -1;
792             goto end;
793           }
794         }
795 end:
796         LOGE("DUAL front thread close %d",rc);
797         return NULL;
798 }
799 
back_thread(void * data)800 static void *back_thread(void *data)
801 {
802         int rc = MM_CAMERA_OK;
803         int back_camera = 0;
804         int i,j,k,m;
805         struct test_case_params params
806           = *((struct test_case_params *)data);
807         for (i = 0; i < params.launch; i++) {
808           LOGE("DUAL open back camera %d\n",i);
809           if(mm_app_open(back_camera) != MM_CAMERA_OK) {
810             LOGE("mm_app_open() back camera err=%d\n", rc);
811             rc = -1;
812             goto end;
813           }
814           if(system_dimension_set(back_camera) != MM_CAMERA_OK){
815             LOGE("system_dimension_set() err=%d\n", rc);
816             rc = -1;
817             goto end;
818           }
819 
820           for (j = 0; j < params.preview; j++) {
821             LOGE("DUAL start camera Preview for back %d, %d\n",i,j);
822             if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
823               LOGE(" startPreview() backcamera err=%d\n",  rc);
824               goto end;
825             }
826             mm_camera_app_wait();
827             usleep(20*1000);
828             for (k = 0; k < params.snapshot; k++) {
829               LOGE("DUAL take picture for back %d, %d, %d\n",i,j,k);
830               if ( MM_CAMERA_OK != (rc = takePicture_yuv(back_camera))) {
831                 LOGE(" TakePicture() err=%d\n",  rc);
832                 goto end;
833               }
834               mm_camera_app_wait();
835               usleep(30*1000);
836             }
837 
838             for (m = 0; m < params.recording; m++) {
839               LOGE("DUAL start record for back %d, %d, %d\n",i,j,m);
840               if ( MM_CAMERA_OK != (rc = startRecording(back_camera))) {
841                 LOGE(" StartVideorecording() err=%d\n",  rc);
842                 break;
843               }
844 
845               mm_camera_app_wait();
846               usleep(10*1000);
847               LOGE("DUAL stop camera record for back \n");
848               if ( MM_CAMERA_OK != (rc = stopRecording(back_camera))) {
849                 LOGE(" Stopvideorecording() err=%d\n",  rc);
850                 break;
851               }
852               usleep(10*1000);
853             }
854             LOGE("DUAL stop camera Preview for back %d, %d\n",i,j);
855             if( MM_CAMERA_OK != (rc = stopPreview(back_camera))) {
856               LOGD(" startPreview() err=%d\n",  rc);
857               goto end;
858             }
859             usleep(10*1000);
860           }
861 
862           LOGE("DUAL close back camera %d\n",i);
863           if( mm_app_close(back_camera) != MM_CAMERA_OK) {
864             LOGE("mm_app_close() err=%d\n", rc);
865             rc = -1;
866             goto end;
867           }
868         }
869 end:
870         LOGE("DUAL back thread close %d",rc);
871         return NULL;
872 }
873 
874 /*  Test case m13572468 : Open & start  in 2 concurrent pthread*/
mm_app_dtc_7(mm_camera_app_t * cam_apps)875 int mm_app_dtc_7(mm_camera_app_t *cam_apps)
876 {
877         int rc = MM_CAMERA_OK;
878         int result = 0;
879         pthread_t back_thread_id, front_thread_id;
880         struct test_case_params params;
881         memset(&params, 0, sizeof(struct test_case_params));
882         params.launch = 5;
883         params.preview = 5;
884         printf("\n Verifying Preview on back Camera and RDI on Front camera 7...\n");
885 
886         LOGE("start back DUAL ");
887         rc = pthread_create(&back_thread_id, NULL, back_thread, &params);
888         LOGE("start front DUAL ");
889         rc = pthread_create(&front_thread_id, NULL, front_thread, &params);
890         sleep(1);
891         LOGE("stop back DUAL ");
892         rc = pthread_join(back_thread_id, NULL);
893         LOGE("stop front DUAL ");
894         rc = pthread_join(front_thread_id, NULL);
895         LOGE("DUAL end \n");
896 
897 end:
898         if(rc == 0) {
899           printf("\nPassed\n");
900         }else{
901           printf("\nFailed\n");
902         }
903         LOGD("END, rc = %d\n",  rc);
904         return rc;
905 }
906 
907 /*  Test case m139572468 : Open & start in 2 concurrent pthread*/
mm_app_dtc_8(mm_camera_app_t * cam_apps)908 int mm_app_dtc_8(mm_camera_app_t *cam_apps)
909 {
910         int rc = MM_CAMERA_OK;
911         int result = 0;
912 
913         pthread_t back_thread_id, front_thread_id;
914         struct test_case_params bparams, fparams;
915         memset(&bparams, 0, sizeof(struct test_case_params));
916         memset(&fparams, 0, sizeof(struct test_case_params));
917         bparams.launch = 5;
918         bparams.preview = 5;
919         bparams.snapshot= 5;
920         fparams.launch = 5;
921         fparams.preview = 5;
922         printf("\n Verifying Preview on back Camera and RDI on Front camera 8...\n");
923 
924         LOGE("start back DUAL ");
925         rc = pthread_create(&back_thread_id, NULL, back_thread, &bparams);
926         LOGE("start front DUAL ");
927         rc = pthread_create(&front_thread_id, NULL, front_thread, &fparams);
928         sleep(1);
929         LOGE("stop back DUAL ");
930         rc = pthread_join(back_thread_id, NULL);
931         LOGE("stop front DUAL ");
932         rc = pthread_join(front_thread_id, NULL);
933         LOGE("DUAL end \n");
934 
935 end:
936         if(rc == 0)
937           printf("\nPassed\n");
938         else
939           printf("\nFailed\n");
940         LOGD("END, rc = %d\n",  rc);
941         return rc;
942 }
943 
944 /*  Test case m1395724c68 : Open & start in 2 concurrent pthread*/
mm_app_dtc_9(mm_camera_app_t * cam_apps)945 int mm_app_dtc_9(mm_camera_app_t *cam_apps)
946 {
947         int rc = MM_CAMERA_OK;
948         int result = 0;
949 
950         pthread_t back_thread_id, front_thread_id;
951         struct test_case_params bparams, fparams;
952         memset(&bparams, 0, sizeof(struct test_case_params));
953         memset(&fparams, 0, sizeof(struct test_case_params));
954         bparams.launch = 5;
955         bparams.preview = 5;
956         bparams.snapshot= 5;
957         fparams.launch = 5;
958         fparams.preview = 5;
959         fparams.snapshot = 5;
960         printf("\n Verifying Preview on back Camera and RDI on Front camera 9...\n");
961 
962         LOGE("start back DUAL ");
963         rc = pthread_create(&back_thread_id, NULL, back_thread, &bparams);
964         LOGE("start front DUAL ");
965         rc = pthread_create(&front_thread_id, NULL, front_thread, &fparams);
966         sleep(1);
967         LOGE("stop back DUAL ");
968         rc = pthread_join(back_thread_id, NULL);
969         LOGE("stop front DUAL ");
970         rc = pthread_join(front_thread_id, NULL);
971         LOGE("DUAL end \n");
972 
973 end:
974         if(rc == 0) {
975           printf("\nPassed\n");
976         }else{
977           printf("\nFailed\n");
978         }
979         LOGD("END, rc = %d\n",  rc);
980         return rc;
981 }
982 
983 /*  Test case m13ab572468 : Open & start in 2 concurrent pthread*/
mm_app_dtc_10(mm_camera_app_t * cam_apps)984 int mm_app_dtc_10(mm_camera_app_t *cam_apps)
985 {
986         int rc = MM_CAMERA_OK;
987         int result = 0;
988 
989         pthread_t back_thread_id, front_thread_id;
990         struct test_case_params bparams, fparams;
991         memset(&bparams, 0, sizeof(struct test_case_params));
992         memset(&fparams, 0, sizeof(struct test_case_params));
993         bparams.launch = 5;
994         bparams.preview = 5;
995         bparams.recording= 5;
996         fparams.launch = 5;
997         fparams.preview = 5;
998         printf("\n Verifying Preview on back Camera and RDI on Front camera 10...\n");
999 
1000         LOGE("start back DUAL ");
1001         rc = pthread_create(&back_thread_id, NULL, back_thread, &bparams);
1002         LOGE("start front DUAL ");
1003         rc = pthread_create(&front_thread_id, NULL, front_thread, &fparams);
1004         sleep(1);
1005         LOGE("stop back DUAL ");
1006         rc = pthread_join(back_thread_id, NULL);
1007         LOGE("stop front DUAL ");
1008         rc = pthread_join(front_thread_id, NULL);
1009         LOGE("DUAL end \n");
1010 end:
1011         if(rc == 0) {
1012           printf("\nPassed\n");
1013         }else{
1014           printf("\nFailed\n");
1015         }
1016         LOGD("END, rc = %d\n",  rc);
1017         return rc;
1018 }
1019 
1020 /*  Test case m13ab5724c68 : Open & start in 2 concurrent pthread*/
mm_app_dtc_11(mm_camera_app_t * cam_apps)1021 int mm_app_dtc_11(mm_camera_app_t *cam_apps)
1022 {
1023         int rc = MM_CAMERA_OK;
1024         int result = 0;
1025 
1026         pthread_t back_thread_id, front_thread_id;
1027         struct test_case_params bparams, fparams;
1028         memset(&bparams, 0, sizeof(struct test_case_params));
1029         memset(&fparams, 0, sizeof(struct test_case_params));
1030         bparams.launch = 5;
1031         bparams.preview = 5;
1032         bparams.recording= 5;
1033         fparams.launch = 5;
1034         fparams.preview = 5;
1035         fparams.snapshot = 5;
1036         printf("\n Verifying Preview on back Camera and RDI on Front camera 11...\n");
1037 
1038         LOGE("start back DUAL ");
1039         rc = pthread_create(&back_thread_id, NULL, back_thread, &bparams);
1040         LOGE("start front DUAL ");
1041         rc = pthread_create(&front_thread_id, NULL, front_thread, &fparams);
1042         sleep(1);
1043         LOGE("stop back DUAL ");
1044         rc = pthread_join(back_thread_id, NULL);
1045         LOGE("stop front DUAL ");
1046         rc = pthread_join(front_thread_id, NULL);
1047         LOGE("DUAL end \n");
1048 
1049 end:
1050         if(rc == 0) {
1051                 printf("\nPassed\n");
1052         }else{
1053                 printf("\nFailed\n");
1054         }
1055         LOGD("END, rc = %d\n",  rc);
1056         return rc;
1057 }
1058 
1059 /*  Test case m1728 : Open & start in 2 concurrent pthread*/
mm_app_dtc_12(mm_camera_app_t * cam_apps)1060 int mm_app_dtc_12(mm_camera_app_t *cam_apps)
1061 {
1062         int rc = MM_CAMERA_OK;
1063         int result = 0;
1064 
1065         pthread_t back_thread_id, front_thread_id;
1066         struct test_case_params bparams, fparams;
1067         memset(&bparams, 0, sizeof(struct test_case_params));
1068         memset(&fparams, 0, sizeof(struct test_case_params));
1069         bparams.launch = 15;
1070         fparams.launch = 15;
1071         printf("\n Verifying Preview on back Camera and RDI on Front camera 12...\n");
1072 
1073         LOGE("start back DUAL ");
1074         rc = pthread_create(&back_thread_id, NULL, back_thread, &bparams);
1075         LOGE("start front DUAL ");
1076         rc = pthread_create(&front_thread_id, NULL, front_thread, &fparams);
1077         sleep(1);
1078         LOGE("stop back DUAL ");
1079         rc = pthread_join(back_thread_id, NULL);
1080         LOGE("stop front DUAL ");
1081         rc = pthread_join(front_thread_id, NULL);
1082         LOGE("DUAL end \n");
1083 
1084 end:
1085         if(rc == 0) {
1086                 printf("\nPassed\n");
1087         }else{
1088                 printf("\nFailed\n");
1089         }
1090         LOGD("END, rc = %d\n",  rc);
1091         return rc;
1092 }
1093 
1094 /*  Test case 2413(ab)5768
1095  *  Test the dual camera usecase. We startPreview on front camera,
1096  *  but backend will allocate RDI buffers and start front camera in
1097  *  RDI streaming mode. It then diverts RDI frames, converts them into YUV 420
1098  *  through C2D and generate preview data in the buffers allocated here.
1099  *  Back camera will use the pixel interface as usual.
1100  */
1101 
mm_app_dtc_13(mm_camera_app_t * cam_apps)1102 int mm_app_dtc_13(mm_camera_app_t *cam_apps)
1103 {
1104         int rc = MM_CAMERA_OK;
1105         int i,j,k;
1106         int result = 0;
1107         int front_camera = 1;
1108         int back_camera = 0;
1109 
1110         printf("\n 13. Verifying Preview + Recording on back Camera and Preview(through RDI) on Front camera\n");
1111         LOGE("DUAL open front camera \n");
1112         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
1113                 LOGE("mm_app_open() front camera err=%d\n", rc);
1114                 rc = -1;
1115                 goto end;
1116         }
1117         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
1118                 LOGE("system_dimension_set() err=%d\n", rc);
1119                 rc = -1;
1120                 goto end;
1121         }
1122 
1123         LOGE("DUAL start camera Preview for front \n");
1124         if( MM_CAMERA_OK != (rc = startPreview(front_camera))) {
1125                LOGE(" front camera startPreview() err=%d\n",  rc);
1126                goto end;
1127         }
1128         mm_camera_app_wait();
1129         usleep(20*1000);
1130 
1131         for (k = 0; k < MM_QCAMERA_APP_INTERATION ; k++){
1132           LOGE("DUAL open back camera %d \n",k);
1133           if(mm_app_open(back_camera) != MM_CAMERA_OK) {
1134                  LOGE("mm_app_open() back camera err=%d\n", rc);
1135                  rc = -1;
1136                  goto end;
1137           }
1138 
1139           if(system_dimension_set(back_camera) != MM_CAMERA_OK){
1140                  LOGE("system_dimension_set() err=%d\n", rc);
1141                  rc = -1;
1142                  goto end;
1143           }
1144 
1145           LOGE("DUAL start camera Preview for back \n");
1146           if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
1147                 LOGE(" back camera startPreview() err=%d\n",  rc);
1148                  goto end;
1149           }
1150           usleep(30*1000);
1151 
1152           for (j = 0; j < MM_QCAMERA_APP_INTERATION; j++) {
1153              LOGE("DUAL start camera record for back Iteration %d \n", j);
1154              if ( MM_CAMERA_OK != (rc = startRecording(back_camera))) {
1155                  LOGE(" StartVideorecording() err=%d\n",  rc);
1156                  break;
1157              }
1158 
1159              mm_camera_app_wait();
1160              usleep(10*1000*1000);
1161              LOGE("DUAL stop camera record for back Iteration %d\n", j);
1162              if ( MM_CAMERA_OK != (rc = stopRecording(back_camera))) {
1163                  LOGE(" Stopvideorecording() err=%d\n",  rc);
1164                  break;
1165              }
1166           }
1167           usleep(10*1000);
1168 
1169           LOGE("DUAL stop camera Preview for back \n");
1170           if( MM_CAMERA_OK != (rc = stopPreview(back_camera))) {
1171                  LOGE(" stopPreview() backcamera err=%d\n",  rc);
1172                  goto end;
1173           }
1174           usleep(10*1000);
1175 
1176           LOGE("DUAL close back camera\n");
1177           if( mm_app_close(back_camera) != MM_CAMERA_OK) {
1178                  LOGE("mm_app_close() err=%d\n", rc);
1179                  rc = -1;
1180                  goto end;
1181           }
1182           usleep(20*1000);
1183         }
1184         LOGE("DUAL stop camera Preview for Rdi \n");
1185         if( MM_CAMERA_OK != (rc = stopPreview(front_camera))) {
1186                 LOGE(" stopPreview() frontcamera err=%d\n",  rc);
1187                 goto end;
1188         }
1189         usleep(10*1000);
1190         LOGE("DUAL close front camera \n");
1191         if( mm_app_close(front_camera) != MM_CAMERA_OK) {
1192                 LOGE("mm_app_close() err=%d\n", rc);
1193                 rc = -1;
1194                 goto end;
1195         }
1196         LOGE("DUAL end \n");
1197 
1198 end:
1199         if(rc == 0) {
1200                 printf("\nPassed\n");
1201         }else{
1202                 printf("\nFailed\n");
1203         }
1204         LOGD("END, rc = %d\n",  rc);
1205         return rc;
1206 }
1207 
1208 /*Below 6  are reference test cases just to test the open path for dual camera*/
mm_app_dtc_1243(mm_camera_app_t * cam_apps)1209 int mm_app_dtc_1243(mm_camera_app_t *cam_apps)
1210 {
1211         int rc = MM_CAMERA_OK;
1212         int i,j;
1213         int result = 0;
1214         int front_camera = 1;
1215         int back_camera = 0;
1216 
1217         printf("\n Verifying Preview on back Camera and RDI on Front camera...\n");
1218         LOGE("DUAL open back camera \n");
1219         if(mm_app_open(back_camera) != MM_CAMERA_OK) {
1220                 LOGE("mm_app_open() back camera err=%d\n", rc);
1221                 rc = -1;
1222                 goto end;
1223         }
1224         if(system_dimension_set(back_camera) != MM_CAMERA_OK){
1225                 LOGE("system_dimension_set() err=%d\n", rc);
1226                 rc = -1;
1227                 goto end;
1228         }
1229 
1230         LOGE("DUAL open front camera \n");
1231         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
1232                 LOGE("mm_app_open() front camera err=%d\n", rc);
1233                 rc = -1;
1234                 goto end;
1235         }
1236 
1237         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
1238                 LOGE("system_dimension_set() err=%d\n", rc);
1239                 rc = -1;
1240                 goto end;
1241         }
1242 
1243         LOGE("DUAL start camera Rdi for front \n");
1244         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
1245                LOGE(" back camera startPreview() err=%d\n",  rc);
1246                 goto end;
1247         }
1248         mm_camera_app_wait();
1249         sleep(1);
1250 
1251         LOGE("DUAL start camera Preview for back \n");
1252 
1253         if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
1254                 LOGE(" startPreview() backcamera err=%d\n",  rc);
1255                 goto end;
1256         }
1257         mm_camera_app_wait();
1258         sleep(1);
1259         LOGE("DUAL end \n");
1260 
1261 end:
1262         if(rc == 0) {
1263                 printf("\nPassed\n");
1264         }else{
1265                 printf("\nFailed\n");
1266         }
1267         LOGD("END, rc = %d\n",  rc);
1268         return rc;
1269 }
1270 
mm_app_dtc_2134(mm_camera_app_t * cam_apps)1271 int mm_app_dtc_2134(mm_camera_app_t *cam_apps)
1272 {
1273         int rc = MM_CAMERA_OK;
1274         int i,j;
1275         int result = 0;
1276         int front_camera = 1;
1277         int back_camera = 0;
1278 
1279         printf("\n Verifying Preview on back Camera and RDI on Front camera...\n");
1280         LOGE("DUAL open front camera \n");
1281         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
1282                 LOGE("mm_app_open() back camera err=%d\n", rc);
1283                 rc = -1;
1284                 goto end;
1285         }
1286         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
1287                 LOGE("system_dimension_set() err=%d\n", rc);
1288                 rc = -1;
1289                 goto end;
1290         }
1291 
1292         LOGE("DUAL open back camera \n");
1293         if(mm_app_open(back_camera) != MM_CAMERA_OK) {
1294                 LOGE("mm_app_open() front camera err=%d\n", rc);
1295                 rc = -1;
1296                 goto end;
1297         }
1298 
1299         if(system_dimension_set(back_camera) != MM_CAMERA_OK){
1300                 LOGE("system_dimension_set() err=%d\n", rc);
1301                 rc = -1;
1302                 goto end;
1303         }
1304 
1305         LOGE("DUAL start camera Preview for front \n");
1306         if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
1307                LOGE(" back camera startPreview() err=%d\n",  rc);
1308                 goto end;
1309         }
1310         mm_camera_app_wait();
1311         sleep(1);
1312 
1313         LOGE("DUAL start camera Rdi for back \n");
1314 
1315         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
1316                 LOGE(" startPreview() backcamera err=%d\n",  rc);
1317                 goto end;
1318         }
1319         mm_camera_app_wait();
1320         sleep(1);
1321         LOGE("DUAL end \n");
1322 
1323 end:
1324         if(rc == 0) {
1325                 printf("\nPassed\n");
1326         }else{
1327                 printf("\nFailed\n");
1328         }
1329         LOGD("END, rc = %d\n",  rc);
1330         return rc;
1331 }
mm_app_dtc_2143(mm_camera_app_t * cam_apps)1332 int mm_app_dtc_2143(mm_camera_app_t *cam_apps)
1333 {
1334         int rc = MM_CAMERA_OK;
1335         int i,j;
1336         int result = 0;
1337         int front_camera = 1;
1338         int back_camera = 0;
1339 
1340         printf("\n Verifying Preview on back Camera and RDI on Front camera...\n");
1341         LOGE("DUAL open front camera \n");
1342         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
1343                 LOGE("mm_app_open() back camera err=%d\n", rc);
1344                 rc = -1;
1345                 goto end;
1346         }
1347         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
1348                 LOGE("system_dimension_set() err=%d\n", rc);
1349                 rc = -1;
1350                 goto end;
1351         }
1352 
1353         LOGE("DUAL open back camera \n");
1354         if(mm_app_open(back_camera) != MM_CAMERA_OK) {
1355                 LOGE("mm_app_open() front camera err=%d\n", rc);
1356                 rc = -1;
1357                 goto end;
1358         }
1359 
1360         if(system_dimension_set(back_camera) != MM_CAMERA_OK){
1361                 LOGE("system_dimension_set() err=%d\n", rc);
1362                 rc = -1;
1363                 goto end;
1364         }
1365 
1366         LOGE("DUAL start camera rdi for front \n");
1367         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
1368                LOGE(" back camera startPreview() err=%d\n",  rc);
1369                 goto end;
1370         }
1371         mm_camera_app_wait();
1372         sleep(1);
1373 
1374         LOGE("DUAL start camera preview for back \n");
1375 
1376         if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
1377                 LOGE(" startPreview() backcamera err=%d\n",  rc);
1378                 goto end;
1379         }
1380         mm_camera_app_wait();
1381         sleep(1);
1382         LOGE("DUAL end \n");
1383 
1384 end:
1385         if(rc == 0) {
1386                 printf("\nPassed\n");
1387         }else{
1388                 printf("\nFailed\n");
1389         }
1390         LOGD("END, rc = %d\n",  rc);
1391         return rc;
1392 }
1393 
mm_app_dtc_2413(mm_camera_app_t * cam_apps)1394 int mm_app_dtc_2413(mm_camera_app_t *cam_apps)
1395 {
1396         int rc = MM_CAMERA_OK;
1397         int i,j;
1398         int result = 0;
1399         int front_camera = 1;
1400         int back_camera = 0;
1401 
1402         printf("\n Verifying Preview on back Camera and RDI on Front camera...\n");
1403         LOGE("DUAL open front camera \n");
1404         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
1405                 LOGE("mm_app_open() back camera err=%d\n", rc);
1406                 rc = -1;
1407                 goto end;
1408         }
1409         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
1410                 LOGE("system_dimension_set() err=%d\n", rc);
1411                 rc = -1;
1412                 goto end;
1413         }
1414 
1415         LOGE("DUAL start camera rdi for front \n");
1416         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
1417                LOGE(" back camera startPreview() err=%d\n",  rc);
1418                 goto end;
1419         }
1420         mm_camera_app_wait();
1421         sleep(1);
1422 
1423         LOGE("DUAL open back camera \n");
1424         if(mm_app_open(back_camera) != MM_CAMERA_OK) {
1425                 LOGE("mm_app_open() front camera err=%d\n", rc);
1426                 rc = -1;
1427                 goto end;
1428         }
1429 
1430         if(system_dimension_set(back_camera) != MM_CAMERA_OK){
1431                 LOGE("system_dimension_set() err=%d\n", rc);
1432                 rc = -1;
1433                 goto end;
1434         }
1435 
1436         LOGE("DUAL start camera preview for back \n");
1437 
1438         if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
1439                 LOGE(" startPreview() backcamera err=%d\n",  rc);
1440                 goto end;
1441         }
1442         mm_camera_app_wait();
1443         sleep(1);
1444         LOGE("DUAL end \n");
1445 
1446 end:
1447         if(rc == 0) {
1448                 printf("\nPassed\n");
1449         }else{
1450                 printf("\nFailed\n");
1451         }
1452         LOGD("END, rc = %d\n",  rc);
1453         return rc;
1454 }
1455 
mm_app_dtc_1234(mm_camera_app_t * cam_apps)1456 int mm_app_dtc_1234(mm_camera_app_t *cam_apps)
1457 {
1458         int rc = MM_CAMERA_OK;
1459         int i,j;
1460         int result = 0;
1461         int front_camera = 1;
1462         int back_camera = 0;
1463 
1464         printf("\n Verifying Preview on back Camera and RDI on Front camera...\n");
1465         LOGE("DUAL open back camera \n");
1466         if(mm_app_open(back_camera) != MM_CAMERA_OK) {
1467                 LOGE("mm_app_open() back camera err=%d\n", rc);
1468                 rc = -1;
1469                 goto end;
1470         }
1471         if(system_dimension_set(back_camera) != MM_CAMERA_OK){
1472                 LOGE("system_dimension_set() err=%d\n", rc);
1473                 rc = -1;
1474                 goto end;
1475         }
1476         LOGE("DUAL open front camera \n");
1477         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
1478                 LOGE("mm_app_open() front camera err=%d\n", rc);
1479                 rc = -1;
1480                 goto end;
1481         }
1482 
1483         if(system_dimension_set(front_camera) != MM_CAMERA_OK){
1484                 LOGE("system_dimension_set() err=%d\n", rc);
1485                 rc = -1;
1486                 goto end;
1487         }
1488 
1489         LOGE("DUAL start camera preview for back \n");
1490         if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
1491                LOGE(" back camera startPreview() err=%d\n",  rc);
1492                 goto end;
1493         }
1494         mm_camera_app_wait();
1495         sleep(1);
1496 
1497         LOGE("DUAL start camera rdi for front \n");
1498 
1499         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
1500                 LOGE(" startPreview() backcamera err=%d\n",  rc);
1501                 goto end;
1502         }
1503         mm_camera_app_wait();
1504         sleep(1);
1505         LOGE("DUAL end \n");
1506 
1507 end:
1508         if(rc == 0) {
1509                 printf("\nPassed\n");
1510         }else{
1511                 printf("\nFailed\n");
1512         }
1513         LOGD("END, rc = %d\n",  rc);
1514         return rc;
1515 }
1516 
mm_app_dtc_1324(mm_camera_app_t * cam_apps)1517 int mm_app_dtc_1324(mm_camera_app_t *cam_apps)
1518 {
1519         int rc = MM_CAMERA_OK;
1520         int i,j;
1521         int result = 0;
1522         int front_camera = 1;
1523         int back_camera = 0;
1524 
1525         printf("\n Verifying Preview on back Camera and RDI on Front camera...\n");
1526         LOGE("DUAL start back camera \n");
1527         if(mm_app_open(back_camera) != MM_CAMERA_OK) {
1528                 LOGE("mm_app_open() back camera err=%d\n", rc);
1529                 rc = -1;
1530                 goto end;
1531         }
1532         if(system_dimension_set(back_camera) != MM_CAMERA_OK){
1533                 LOGE("system_dimension_set() err=%d\n", rc);
1534                 rc = -1;
1535                 goto end;
1536         }
1537         LOGE("DUAL start camera preview for back \n");
1538         if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
1539                 LOGE(" back camera startPreview() err=%d\n",  rc);
1540                 goto end;
1541         }
1542         //mm_camera_app_wait();
1543         sleep(1);
1544         LOGE("DUAL start front camera \n");
1545         if(mm_app_open(front_camera) != MM_CAMERA_OK) {
1546                 LOGE("mm_app_open() front camera err=%d\n", rc);
1547                 rc = -1;
1548                 goto end;
1549         }
1550 
1551        if(system_dimension_set(front_camera) != MM_CAMERA_OK){
1552                 LOGE("system_dimension_set() err=%d\n", rc);
1553                 rc = -1;
1554                 goto end;
1555         }
1556         LOGE("DUAL start rdi preview \n");
1557 
1558         if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
1559                 LOGE(" startPreview() backcamera err=%d\n",  rc);
1560                 goto end;
1561         }
1562         mm_camera_app_wait();
1563         sleep(1);
1564         LOGE("DUAL end \n");
1565 
1566 end:
1567         if(rc == 0) {
1568           printf("\nPassed\n");
1569         }else{
1570           printf("\nFailed\n");
1571         }
1572         LOGD("END, rc = %d\n",  rc);
1573         return rc;
1574 }
1575 
1576 /* single camera test cases*/
mm_app_dtc_s_0(mm_camera_app_t * cam_apps)1577 int mm_app_dtc_s_0(mm_camera_app_t *cam_apps)
1578 {
1579     int rc = MM_CAMERA_OK;
1580     int i,j;
1581     int result = 0;
1582     int front_camera = 1;
1583     int back_camera = 0;
1584 
1585     printf("\n Verifying Preview on back Camera and RDI on Front camera...\n");
1586 
1587     if(mm_app_open(back_camera) != MM_CAMERA_OK) {
1588         LOGE("mm_app_open() back camera err=%d\n", rc);
1589         rc = -1;
1590         goto end;
1591     }
1592     if(system_dimension_set(back_camera) != MM_CAMERA_OK){
1593     LOGE("system_dimension_set() err=%d\n", rc);
1594         rc = -1;
1595         goto end;
1596     }
1597 
1598     if( MM_CAMERA_OK != (rc = startPreview(back_camera))) {
1599         LOGE(" back camera startPreview() err=%d\n",  rc);
1600         goto end;
1601     }
1602 
1603     mm_camera_app_wait();
1604     if(mm_app_open(front_camera) != MM_CAMERA_OK) {
1605         LOGE("mm_app_open() front camera err=%d\n", rc);
1606         rc = -1;
1607         goto end;
1608     }
1609     if(system_dimension_set(front_camera) != MM_CAMERA_OK){
1610         LOGE("system_dimension_set() err=%d\n", rc);
1611         rc = -1;
1612         goto end;
1613     }
1614 
1615     if( MM_CAMERA_OK != (rc = startRdi(front_camera))) {
1616         LOGE(" startPreview() backcamera err=%d\n",  rc);
1617         goto end;
1618     }
1619     mm_camera_app_wait();
1620 
1621     if( MM_CAMERA_OK != (rc = stopRdi(front_camera))) {
1622         LOGE(" startPreview() backcamera err=%d\n",  rc);
1623         goto end;
1624     }
1625 
1626     if( MM_CAMERA_OK != (rc = stopPreview(my_cam_app.cam_open))) {
1627         LOGD(" startPreview() err=%d\n",  rc);
1628         goto end;
1629     }
1630 
1631     if( mm_app_close(my_cam_app.cam_open) != MM_CAMERA_OK) {
1632         LOGE("mm_app_close() err=%d\n", rc);
1633         rc = -1;
1634         goto end;
1635     }
1636 end:
1637     if(rc == 0) {
1638         printf("\nPassed\n");
1639     }else{
1640         printf("\nFailed\n");
1641     }
1642     LOGD("END, rc = %d\n",  rc);
1643     return rc;
1644 }
1645 
mm_app_dtc_s_1(mm_camera_app_t * cam_apps)1646 int mm_app_dtc_s_1(mm_camera_app_t *cam_apps)
1647 {
1648     int rc = MM_CAMERA_OK;
1649     int i,j;
1650     int result = 0;
1651 
1652     printf("\n Verifying Snapshot on front and back camera...\n");
1653     for(i = 0; i < cam_apps->num_cameras; i++) {
1654         if( mm_app_open(i) != MM_CAMERA_OK) {
1655             LOGE("mm_app_open() err=%d\n", rc);
1656             rc = -1;
1657             goto end;
1658         }
1659         if(system_dimension_set(my_cam_app.cam_open) != MM_CAMERA_OK){
1660             LOGE("system_dimension_set() err=%d\n", rc);
1661             rc = -1;
1662             goto end;
1663         }
1664 
1665         if( MM_CAMERA_OK != (rc = startPreview(my_cam_app.cam_open))) {
1666                 LOGE(" startPreview() err=%d\n",  rc);
1667                 break;
1668         }
1669         for(j = 0; j < MM_QCAMERA_APP_INTERATION; j++) {
1670             if( MM_CAMERA_OK != (rc = takePicture_yuv(my_cam_app.cam_open))) {
1671                 LOGE(" TakePicture() err=%d\n",  rc);
1672                 break;
1673             }
1674             /*if(mm_camera_app_timedwait() == ETIMEDOUT) {
1675                 LOGE(" Snapshot/Preview Callback not received in time or qbuf Faile\n");
1676                 break;
1677             }*/
1678             mm_camera_app_wait();
1679             result++;
1680         }
1681         if( MM_CAMERA_OK != (rc = stopPreview(my_cam_app.cam_open))) {
1682             LOGD(" startPreview() err=%d\n",  rc);
1683             break;
1684         }
1685         if( mm_app_close(my_cam_app.cam_open) != MM_CAMERA_OK) {
1686             LOGE("mm_app_close() err=%d\n", rc);
1687             rc = -1;
1688             goto end;
1689         }
1690         if(result != MM_QCAMERA_APP_INTERATION) {
1691             printf(" Snapshot Start/Stop Fails for Camera %d in %d iteration",  i,j);
1692             rc = -1;
1693             break;
1694         }
1695 
1696         result = 0;
1697     }
1698 end:
1699     if(rc == 0) {
1700         printf("\t***Passed***\n");
1701     }else{
1702         printf("\t***Failed***\n");
1703     }
1704     LOGD("END, rc = %d\n",  rc);
1705     return rc;
1706 }
1707 
mm_app_dtc_s_2(mm_camera_app_t * cam_apps)1708 int mm_app_dtc_s_2(mm_camera_app_t *cam_apps)
1709 {
1710     int rc = MM_CAMERA_OK;
1711     int i,j;
1712     int result = 0;
1713 
1714     printf("\n Verifying Video on front and back camera...\n");
1715     for(i = 0; i < cam_apps->num_cameras; i++) {
1716         if( mm_app_open(i) != MM_CAMERA_OK) {
1717             LOGE("mm_app_open() err=%d\n", rc);
1718             rc = -1;
1719             goto end;
1720         }
1721         if(system_dimension_set(my_cam_app.cam_open) != MM_CAMERA_OK){
1722             LOGE("system_dimension_set() err=%d\n", rc);
1723             rc = -1;
1724             goto end;
1725         }
1726 
1727         if( MM_CAMERA_OK != (rc = startPreview(my_cam_app.cam_open))) {
1728             LOGE(" startPreview() err=%d\n",  rc);
1729             break;
1730         }
1731         for(j = 0; j < MM_QCAMERA_APP_INTERATION; j++) {
1732             if( MM_CAMERA_OK != (rc = startRecording(my_cam_app.cam_open))) {
1733                 LOGE(" StartVideorecording() err=%d\n",  rc);
1734                 break;
1735             }
1736 
1737             /*if(mm_camera_app_timedwait() == ETIMEDOUT) {
1738             LOGE(" Video Callback not received in time\n");
1739             break;
1740             }*/
1741             mm_camera_app_wait();
1742             if( MM_CAMERA_OK != (rc = stopRecording(my_cam_app.cam_open))) {
1743                 LOGE(" Stopvideorecording() err=%d\n",  rc);
1744                 break;
1745             }
1746             result++;
1747         }
1748         if( MM_CAMERA_OK != (rc = stopPreview(my_cam_app.cam_open))) {
1749             LOGD(" startPreview() err=%d\n",  rc);
1750             break;
1751         }
1752         if( mm_app_close(my_cam_app.cam_open) != MM_CAMERA_OK) {
1753             LOGE("mm_app_close() err=%d\n", rc);
1754             rc = -1;
1755             goto end;
1756         }
1757         if(result != MM_QCAMERA_APP_INTERATION) {
1758             printf(" Video Start/Stop Fails for Camera %d in %d iteration",  i,j);
1759             rc = -1;
1760             break;
1761         }
1762 
1763         result = 0;
1764     }
1765 end:
1766     if(rc == 0) {
1767         printf("\nPassed\n");
1768     }else{
1769         printf("\nFailed\n");
1770     }
1771     LOGD("END, rc = %d\n",  rc);
1772     return rc;
1773 }
1774 
mm_app_dtc_s_3(mm_camera_app_t * cam_apps)1775 int mm_app_dtc_s_3(mm_camera_app_t *cam_apps)
1776 {
1777     int rc = MM_CAMERA_OK;
1778     int i,j;
1779     int result = 0;
1780 
1781     printf("\n Verifying RDI Stream on front and back camera...\n");
1782     if(cam_apps->num_cameras == 0) {
1783         LOGE("Query Failed: Num of cameras = %d\n", cam_apps->num_cameras);
1784         rc = -1;
1785         goto end;
1786     }
1787     for(i = 0; i < cam_apps->num_cameras; i++) {
1788         if( mm_app_open(i) != MM_CAMERA_OK) {
1789             LOGE("mm_app_open() err=%d\n", rc);
1790             rc = -1;
1791             goto end;
1792         }
1793         if(system_dimension_set(my_cam_app.cam_open) != MM_CAMERA_OK){
1794             LOGE("system_dimension_set() err=%d\n", rc);
1795             rc = -1;
1796             goto end;
1797         }
1798         for(j = 0; j < MM_QCAMERA_APP_INTERATION; j++) {
1799             if( MM_CAMERA_OK != (rc = startRdi(my_cam_app.cam_open))) {
1800                 LOGE(" StartVideorecording() err=%d\n",  rc);
1801                 break;
1802             }
1803 
1804             /*if(mm_camera_app_timedwait() == ETIMEDOUT) {
1805             LOGE(" Video Callback not received in time\n");
1806             break;
1807             }*/
1808             mm_camera_app_wait();
1809             if( MM_CAMERA_OK != (rc = stopRdi(my_cam_app.cam_open))) {
1810                 LOGE(" Stopvideorecording() err=%d\n",  rc);
1811                 break;
1812             }
1813             result++;
1814         }
1815         if( mm_app_close(my_cam_app.cam_open) != MM_CAMERA_OK) {
1816             LOGE("mm_app_close() err=%d\n", rc);
1817             rc = -1;
1818             goto end;
1819         }
1820         if(result != MM_QCAMERA_APP_INTERATION) {
1821             printf(" Video Start/Stop Fails for Camera %d in %d iteration",  i,j);
1822             rc = -1;
1823             break;
1824         }
1825 
1826         result = 0;
1827     }
1828 end:
1829     if(rc == 0) {
1830         printf("\nPassed\n");
1831     }else{
1832         printf("\nFailed\n");
1833     }
1834     LOGD("END, rc = %d\n",  rc);
1835     return rc;
1836 }
1837 
1838 /*Stats Test Case*/
mm_app_dtc_s_5(mm_camera_app_t * cam_apps)1839 int mm_app_dtc_s_5(mm_camera_app_t *cam_apps)
1840 {
1841     int rc = MM_CAMERA_OK;
1842     int i,j;
1843     int result = 0;
1844     int front_camera = 1;
1845     int back_camera = 0;
1846 
1847     printf("\n Verifying Preview on back Camera and RDI on Front camera...\n");
1848 
1849     if(mm_app_open(back_camera) != MM_CAMERA_OK) {
1850         LOGE("mm_app_open() back camera err=%d\n", rc);
1851         rc = -1;
1852         goto end;
1853     }
1854     if(system_dimension_set(back_camera) != MM_CAMERA_OK){
1855     LOGE("system_dimension_set() err=%d\n", rc);
1856         rc = -1;
1857         goto end;
1858     }
1859 
1860     if( MM_CAMERA_OK != (rc = startStats(back_camera))) {
1861         LOGE(" back camera startPreview() err=%d\n",  rc);
1862         goto end;
1863     }
1864 
1865     mm_camera_app_wait();
1866 
1867     if( MM_CAMERA_OK != (rc = stopStats(my_cam_app.cam_open))) {
1868         LOGD(" startPreview() err=%d\n",  rc);
1869         goto end;
1870     }
1871 
1872     if( mm_app_close(my_cam_app.cam_open) != MM_CAMERA_OK) {
1873         LOGE("mm_app_close() err=%d\n", rc);
1874         rc = -1;
1875         goto end;
1876     }
1877 end:
1878     if(rc == 0) {
1879         printf("\nPassed\n");
1880     }else{
1881         printf("\nFailed\n");
1882     }
1883     LOGD("END, rc = %d\n",  rc);
1884     return rc;
1885 }
1886 
mm_app_gen_dual_test_cases()1887 int mm_app_gen_dual_test_cases()
1888 {
1889     int tc = 0;
1890     memset(mm_app_tc, 0, sizeof(mm_app_tc));
1891     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_0;
1892     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_1;
1893     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_2;
1894     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_3;
1895     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_4;
1896     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_5;
1897     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_6;
1898     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_7;
1899     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_8;
1900     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_9;
1901     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_10;
1902     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_11;
1903     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_12;
1904     if(tc < MM_QCAM_APP_TEST_NUM) mm_app_tc[tc++].f = mm_app_dtc_13;
1905 
1906     return tc;
1907 }
1908 
mm_app_dual_test_entry(mm_camera_app_t * cam_app)1909 int mm_app_dual_test_entry(mm_camera_app_t *cam_app)
1910 {
1911     int rc = MM_CAMERA_OK;
1912     int i, tc = 0;
1913     int cam_id = 0;
1914 
1915     tc = mm_app_gen_dual_test_cases();
1916     LOGD("Running %d test cases\n",tc);
1917     for(i = 0; i < tc; i++) {
1918         mm_app_tc[i].r = mm_app_tc[i].f(cam_app);
1919         if(mm_app_tc[i].r != MM_CAMERA_OK) {
1920             printf(" test case %d error = %d, abort unit testing engine!!!!\n",
1921                      i, mm_app_tc[i].r);
1922             rc = mm_app_tc[i].r;
1923             goto end;
1924         }
1925     }
1926 end:
1927     printf("nTOTAL_TSET_CASE = %d, NUM_TEST_RAN = %d, rc=%d\n", tc, i, rc);
1928     return rc;
1929 }
1930 
1931 
1932 
1933 
1934