Initialize Tizen 2.3
[framework/telephony/libslp-tapi.git] / wearable / TC / testcase / utc_sim.c
1 /*
2  * libslp-tapi
3  *
4  * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ankit Jogi <ankit.jogi@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 #include <tet_api.h>
22 #include <stdlib.h>
23
24 #include <tapi_common.h>
25 #include <ITapiSim.h>
26 #include <TapiUtility.h>
27
28 #include "util_common.h"
29
30 TapiHandle *handle;
31 enum async_state async_flag;
32
33
34 /**
35  * tel_get_sim_init_info
36  *
37  */
38 static void utc_tel_get_sim_init_info (void)
39 {
40         int ret;
41         TelSimCardStatus_t sim_status;
42         int card_changed;
43
44         util_init_loop ();
45
46         ret = tel_get_sim_init_info (handle, &sim_status, &card_changed);
47         if (ret != TAPI_API_SUCCESS) {
48                 dts_fail("tel_get_sim_init_info", "Unexpected return");
49         }
50
51         dts_pass("tel_get_sim_init_info");
52 }
53
54 static void utc_fail_tel_get_sim_init_info (void)
55 {
56         int ret;
57         TelSimCardStatus_t sim_status;
58         int card_changed;
59
60         ret = tel_get_sim_init_info (NULL, &sim_status, &card_changed);
61         if (ret == TAPI_API_SUCCESS) {
62                 dts_fail("tel_get_sim_init_info", "Parameter check failed");
63         }
64
65         ret = tel_get_sim_init_info (handle, NULL, &card_changed);
66         if (ret == TAPI_API_SUCCESS) {
67                 dts_fail("tel_get_sim_init_info", "Parameter check failed");
68         }
69
70         ret = tel_get_sim_init_info (handle, &sim_status, NULL);
71         if (ret == TAPI_API_SUCCESS) {
72                 dts_fail("tel_get_sim_init_info", "Parameter check failed");
73         }
74
75         ret = tel_get_sim_init_info (handle, NULL, NULL);
76         if (ret == TAPI_API_SUCCESS) {
77                 dts_fail("tel_get_sim_init_info", "Parameter check failed");
78         }
79
80         dts_pass("tel_get_sim_init_info");
81 }
82
83 /**
84  * tel_get_sim_type
85  *
86  */
87 static void utc_tel_get_sim_type (void)
88 {
89         int ret;
90         TelSimCardType_t card_type;
91
92         util_init_loop ();
93
94         ret = tel_get_sim_type (handle, &card_type);
95         if (ret != TAPI_API_SUCCESS) {
96                 dts_fail("tel_get_sim_type", "Unexpected return");
97         }
98
99         dts_pass("tel_get_sim_type");
100 }
101
102 static void utc_fail_tel_get_sim_type (void)
103 {
104         int ret;
105         TelSimCardType_t card_type;
106
107         ret = tel_get_sim_type (NULL, &card_type);
108         if (ret == TAPI_API_SUCCESS) {
109                 dts_fail("tel_get_sim_type", "Parameter check failed");
110         }
111
112         ret = tel_get_sim_type (handle, NULL);
113         if (ret == TAPI_API_SUCCESS) {
114                 dts_fail("tel_get_sim_type", "Parameter check failed");
115         }
116
117         dts_pass("tel_get_sim_type");
118 }
119
120 /**
121  * tel_get_sim_imsi
122  *
123  */
124 static void utc_tel_get_sim_imsi (void)
125 {
126         int ret;
127         TelSimImsiInfo_t imsi;
128
129         util_init_loop ();
130
131         ret = tel_get_sim_imsi (handle, &imsi);
132         if (ret != TAPI_API_SUCCESS) {
133                 dts_fail("tel_get_sim_imsi", "Unexpected return");
134         }
135
136         dts_pass("tel_get_sim_imsi");
137 }
138
139 static void utc_fail_tel_get_sim_imsi (void)
140 {
141         int ret;
142         TelSimImsiInfo_t imsi;
143
144         ret = tel_get_sim_imsi (NULL, &imsi);
145         if (ret == TAPI_API_SUCCESS) {
146                 dts_fail("tel_get_sim_imsi", "Parameter check failed");
147         }
148
149         ret = tel_get_sim_imsi (handle, NULL);
150         if (ret == TAPI_API_SUCCESS) {
151                 dts_fail("tel_get_sim_imsi", "Parameter check failed");
152         }
153
154         dts_pass("tel_get_sim_imsi");
155 }
156
157 /**
158  * tel_get_sim_ecc
159  *
160  */
161 static void utc_tel_get_sim_ecc (void)
162 {
163         int ret;
164         TelSimEccList_t ecc;
165
166         util_init_loop ();
167
168         ret = tel_get_sim_ecc (handle, &ecc);
169         if (ret != TAPI_API_SUCCESS) {
170                 dts_fail("tel_get_sim_ecc", "Unexpected return");
171         }
172
173         dts_pass("tel_get_sim_ecc");
174 }
175
176 static void utc_fail_tel_get_sim_ecc (void)
177 {
178         int ret;
179         TelSimEccList_t ecc;
180
181         ret = tel_get_sim_ecc (NULL, &ecc);
182         if (ret == TAPI_API_SUCCESS) {
183                 dts_fail("tel_get_sim_ecc", "Parameter check failed");
184         }
185
186         ret = tel_get_sim_ecc (handle, NULL);
187         if (ret == TAPI_API_SUCCESS) {
188                 dts_fail("tel_get_sim_ecc", "Parameter check failed");
189         }
190
191         dts_pass("tel_get_sim_ecc");
192 }
193
194 /**
195  * tel_set_sim_language
196  *
197  */
198 static void on_tel_set_sim_language (TapiHandle *handle, int result,
199                 void *data, void *user_data)
200 {
201         int *value = user_data;
202
203         async_flag = ASYNC_DONE;
204         util_stop_loop ();
205
206         if (*value != 0xC0FFEE) {
207                 dts_fail("tel_set_sim_language", "Callback userdata crashed");
208         }
209 }
210
211 static void utc_tel_set_sim_language (void)
212 {
213         int ret;
214         int value = 0xC0FFEE;
215
216         util_init_loop ();
217
218         async_flag = ASYNC_READY;
219         ret = tel_set_sim_language (handle, 2, on_tel_set_sim_language, &value);
220         if (ret != TAPI_API_SUCCESS) {
221                 dts_fail("tel_set_sim_language", "Unexpected return");
222         }
223
224         util_start_loop ();
225         util_free_loop ();
226
227         if (async_flag != ASYNC_DONE) {
228                 dts_fail("tel_set_sim_language", "Callback not invoked");
229         }
230
231         dts_pass("tel_set_sim_language");
232 }
233
234 static void utc_fail_tel_set_sim_language (void)
235 {
236         int ret;
237
238         ret = tel_set_sim_language (NULL, 0, NULL, NULL);
239         if (ret == TAPI_API_SUCCESS) {
240                 dts_fail("tel_set_sim_language", "Parameter check failed");
241         }
242
243         dts_pass("tel_set_sim_language");
244 }
245
246 /**
247  * tel_set_sim_callforwarding_info
248  *
249  */
250 static void on_tel_set_sim_callforwarding_info (TapiHandle *handle, int result,
251                 void *data, void *user_data)
252 {
253         int *value = user_data;
254
255         async_flag = ASYNC_DONE;
256         util_stop_loop ();
257
258         if (*value != 0xC0FFEE) {
259                 dts_fail("tel_set_sim_callforwarding_info", "Callback userdata crashed");
260         }
261 }
262
263 static void utc_tel_set_sim_callforwarding_info (void)
264 {
265         int ret;
266         int value = 0xC0FFEE;
267         TelSimCallForwardingReq_t req_cphs_cf;
268
269         memset (&req_cphs_cf, 0, sizeof(TelSimCallForwardingReq_t));
270
271         req_cphs_cf.b_cphs = 1;
272         req_cphs_cf.cf_data_u.cphs_cf.b_line1 = 1;
273         req_cphs_cf.cf_data_u.cphs_cf.b_line2 = 0;
274         req_cphs_cf.cf_data_u.cphs_cf.b_fax = 1;
275         req_cphs_cf.cf_data_u.cphs_cf.b_data = 0;
276
277         util_init_loop ();
278
279         async_flag = ASYNC_READY;
280         ret = tel_set_sim_callforwarding_info (handle, &req_cphs_cf, on_tel_set_sim_callforwarding_info, &value);
281         if (ret != TAPI_API_SUCCESS) {
282                 dts_fail("tel_set_sim_callforwarding_info", "Unexpected return");
283         }
284
285         util_start_loop ();
286         util_free_loop ();
287
288         if (async_flag != ASYNC_DONE) {
289                 dts_fail("tel_set_sim_callforwarding_info", "Callback not invoked");
290         }
291
292         dts_pass("tel_set_sim_callforwarding_info");
293 }
294
295 static void utc_fail_tel_set_sim_callforwarding_info (void)
296 {
297         int ret;
298         TelSimCallForwardingReq_t req_cphs_cf;
299
300         memset (&req_cphs_cf, 0, sizeof(TelSimCallForwardingReq_t));
301
302         req_cphs_cf.b_cphs = 1;
303         req_cphs_cf.cf_data_u.cphs_cf.b_line1 = 1;
304         req_cphs_cf.cf_data_u.cphs_cf.b_line2 = 0;
305         req_cphs_cf.cf_data_u.cphs_cf.b_fax = 1;
306         req_cphs_cf.cf_data_u.cphs_cf.b_data = 0;
307
308         ret = tel_set_sim_callforwarding_info (NULL, &req_cphs_cf, NULL, NULL);
309         if (ret == TAPI_API_SUCCESS) {
310                 dts_fail("tel_set_sim_callforwarding_info", "Parameter check failed");
311         }
312
313         ret = tel_set_sim_callforwarding_info (handle, NULL, NULL, NULL);
314         if (ret == TAPI_API_SUCCESS) {
315                 dts_fail("tel_set_sim_callforwarding_info", "Parameter check failed");
316         }
317
318         dts_pass("tel_set_sim_callforwarding_info");
319 }
320
321 /**
322  * tel_set_sim_messagewaiting_info
323  *
324  */
325 static void on_tel_set_sim_messagewaiting_info (TapiHandle *handle, int result,
326                 void *data, void *user_data)
327 {
328         int *value = user_data;
329
330         async_flag = ASYNC_DONE;
331         util_stop_loop ();
332
333         if (*value != 0xC0FFEE) {
334                 dts_fail("tel_set_sim_messagewaiting_info", "Callback userdata crashed");
335         }
336 }
337
338 static void utc_tel_set_sim_messagewaiting_info (void)
339 {
340         int ret;
341         int value = 0xC0FFEE;
342         TelSimMessageWaitingReq_t req_mw;
343
344         memset (&req_mw, 0, sizeof(TelSimMessageWaitingReq_t));
345
346         req_mw.b_cphs = 1;
347         req_mw.mw_data_u.cphs_mw.b_voice1 = 1;
348         req_mw.mw_data_u.cphs_mw.b_voice2 = 0;
349         req_mw.mw_data_u.cphs_mw.b_fax = 1;
350         req_mw.mw_data_u.cphs_mw.b_data = 0;
351
352         util_init_loop ();
353
354         async_flag = ASYNC_READY;
355         ret = tel_set_sim_messagewaiting_info (handle, &req_mw, on_tel_set_sim_messagewaiting_info, &value);
356         if (ret != TAPI_API_SUCCESS) {
357                 dts_fail("tel_set_sim_messagewaiting_info", "Unexpected return");
358         }
359
360         util_start_loop ();
361         util_free_loop ();
362
363         if (async_flag != ASYNC_DONE) {
364                 dts_fail("tel_set_sim_messagewaiting_info", "Callback not invoked");
365         }
366
367         dts_pass("tel_set_sim_callforwarding_info");
368 }
369
370 static void utc_fail_tel_set_sim_messagewaiting_info (void)
371 {
372         int ret;
373         TelSimMessageWaitingReq_t req_mw;
374
375         memset (&req_mw, 0, sizeof(TelSimMessageWaitingReq_t));
376
377         req_mw.b_cphs = 1;
378         req_mw.mw_data_u.cphs_mw.b_voice1 = 1;
379         req_mw.mw_data_u.cphs_mw.b_voice2 = 0;
380         req_mw.mw_data_u.cphs_mw.b_fax = 1;
381         req_mw.mw_data_u.cphs_mw.b_data = 0;
382
383         ret = tel_set_sim_messagewaiting_info (NULL, &req_mw, NULL, NULL);
384         if (ret == TAPI_API_SUCCESS) {
385                 dts_fail("tel_set_sim_messagewaiting_info", "Parameter check failed");
386         }
387
388         ret = tel_set_sim_messagewaiting_info (handle, NULL, NULL, NULL);
389         if (ret == TAPI_API_SUCCESS) {
390                 dts_fail("tel_set_sim_messagewaiting_info", "Parameter check failed");
391         }
392
393         dts_pass("tel_set_sim_messagewaiting_info");
394 }
395
396 /**
397  * tel_set_sim_mailbox_info
398  *
399  */
400 static void on_tel_set_sim_mailbox_info (TapiHandle *handle, int result,
401                 void *data, void *user_data)
402 {
403         int *value = user_data;
404
405         async_flag = ASYNC_DONE;
406         util_stop_loop ();
407
408         if (*value != 0xC0FFEE) {
409                 dts_fail("tel_set_sim_mailbox_info", "Callback userdata crashed");
410         }
411 }
412
413 static void utc_tel_set_sim_mailbox_info (void)
414 {
415         int ret;
416         int value = 0xC0FFEE;
417         TelSimMailBoxNumber_t req_mb;
418
419         memset (&req_mb, 0, sizeof(TelSimMailBoxNumber_t));
420
421         req_mb.b_cphs = 1;
422         req_mb.rec_index = 1;
423         req_mb.profile_num = 1;
424         req_mb.mb_type = 1;
425         req_mb.alpha_id_max_len = 10;
426         strcpy (req_mb.alpha_id, "123456");
427         req_mb.ton = 2;
428         req_mb.npi = 8;
429         strcpy (req_mb.num, "9988776655");
430
431         util_init_loop ();
432
433         async_flag = ASYNC_READY;
434         ret = tel_set_sim_mailbox_info (handle, &req_mb, on_tel_set_sim_mailbox_info, &value);
435         if (ret != TAPI_API_SUCCESS) {
436                 dts_fail("tel_set_sim_mailbox_info", "Unexpected return");
437         }
438
439         util_start_loop ();
440         util_free_loop ();
441
442         if (async_flag != ASYNC_DONE) {
443                 dts_fail("tel_set_sim_mailbox_info", "Callback not invoked");
444         }
445
446         dts_pass("tel_set_sim_mailbox_info");
447 }
448
449 static void utc_fail_tel_set_sim_mailbox_info (void)
450 {
451         int ret;
452         TelSimMailBoxNumber_t req_mb;
453
454         memset (&req_mb, 0, sizeof(TelSimMailBoxNumber_t));
455
456         req_mb.b_cphs = 1;
457         req_mb.rec_index = 1;
458         req_mb.profile_num = 1;
459         req_mb.mb_type = 1;
460         req_mb.alpha_id_max_len = 10;
461         strcpy (req_mb.alpha_id, "123456");
462         req_mb.ton = 2;
463         req_mb.npi = 8;
464         strcpy (req_mb.num, "9988776655");
465
466         ret = tel_set_sim_mailbox_info (NULL, &req_mb, NULL, NULL);
467         if (ret == TAPI_API_SUCCESS) {
468                 dts_fail("tel_set_sim_mailbox_info", "Parameter check failed");
469         }
470
471         ret = tel_set_sim_mailbox_info (handle, NULL, NULL, NULL);
472         if (ret == TAPI_API_SUCCESS) {
473                 dts_fail("tel_set_sim_mailbox_info", "Parameter check failed");
474         }
475
476         dts_pass("tel_set_sim_mailbox_info");
477 }
478
479 /**
480  * tel_req_sim_authentication
481  *
482  */
483 static void on_tel_req_sim_authentication (TapiHandle *handle, int result,
484                 void *data, void *user_data)
485 {
486         int *value = user_data;
487
488         async_flag = ASYNC_DONE;
489         util_stop_loop ();
490
491         if (*value != 0xC0FFEE) {
492                 dts_fail("tel_set_sim_mailbox_info", "Callback userdata crashed");
493         }
494 }
495
496 static void utc_tel_req_sim_authentication (void)
497 {
498         int ret;
499         int value = 0xC0FFEE;
500         TelSimAuthenticationData_t authentication_data;
501
502         memset (&authentication_data, 0, sizeof(TelSimAuthenticationData_t));
503
504         authentication_data.auth_type = 1;
505         authentication_data.rand_length = 16;
506         authentication_data.autn_length = 16;
507         strcpy (authentication_data.rand_data, "AAAAAAAAAAAAAAAA");
508         strcpy (authentication_data.autn_data, "AAAAAAAAAAAAAAAA");
509
510         util_init_loop ();
511
512         async_flag = ASYNC_READY;
513         ret = tel_req_sim_authentication (handle, &authentication_data, on_tel_req_sim_authentication, &value);
514         if (ret != TAPI_API_SUCCESS) {
515                 dts_fail("tel_req_sim_authentication", "Unexpected return");
516         }
517
518         util_start_loop ();
519         util_free_loop ();
520
521         if (async_flag != ASYNC_DONE) {
522                 dts_fail("tel_req_sim_authentication", "Callback not invoked");
523         }
524
525         dts_pass("tel_req_sim_authentication");
526 }
527
528 static void utc_fail_tel_req_sim_authentication (void)
529 {
530         int ret;
531         TelSimAuthenticationData_t authentication_data;
532
533         memset (&authentication_data, 0, sizeof(TelSimAuthenticationData_t));
534
535         authentication_data.auth_type = 1;
536         authentication_data.rand_length = 16;
537         authentication_data.autn_length = 16;
538         strcpy (authentication_data.rand_data, "AAAAAAAAAAAAAAAA");
539         strcpy (authentication_data.autn_data, "AAAAAAAAAAAAAAAA");
540
541         ret = tel_req_sim_authentication (NULL, &authentication_data, NULL, NULL);
542         if (ret == TAPI_API_SUCCESS) {
543                 dts_fail("tel_req_sim_authentication", "Parameter check failed");
544         }
545
546         ret = tel_req_sim_authentication (handle, NULL, NULL, NULL);
547         if (ret == TAPI_API_SUCCESS) {
548                 dts_fail("tel_req_sim_authentication", "Parameter check failed");
549         }
550
551         dts_pass("tel_req_sim_authentication");
552 }
553
554 /**
555  * tel_verifiy_sim_pins
556  *
557  */
558 static void on_tel_verifiy_sim_pins (TapiHandle *handle, int result,
559                 void *data, void *user_data)
560 {
561         int *value = user_data;
562
563         async_flag = ASYNC_DONE;
564         util_stop_loop ();
565
566         if (*value != 0xC0FFEE) {
567                 dts_fail("tel_verifiy_sim_pins", "Callback userdata crashed");
568         }
569 }
570
571 static void utc_tel_verifiy_sim_pins (void)
572 {
573         int ret;
574         int value = 0xC0FFEE;
575         TelSimSecPw_t pin_data;
576
577         memset (&pin_data, 0, sizeof(TelSimSecPw_t));
578
579         pin_data.type = 0;
580         pin_data.pw_len = 4;
581         pin_data.pw = calloc(1, pin_data.pw_len);
582         strcpy ((char *)pin_data.pw, "1234");
583
584         util_init_loop ();
585
586         async_flag = ASYNC_READY;
587         ret = tel_verifiy_sim_pins (handle, &pin_data, on_tel_verifiy_sim_pins, &value);
588         if (ret != TAPI_API_SUCCESS) {
589                 dts_fail("tel_verifiy_sim_pins", "Unexpected return");
590         }
591
592         util_start_loop ();
593         util_free_loop ();
594
595         if (async_flag != ASYNC_DONE) {
596                 dts_fail("tel_verifiy_sim_pins", "Callback not invoked");
597         }
598
599         dts_pass("tel_verifiy_sim_pins");
600         free(pin_data.pw);
601 }
602
603 static void utc_fail_tel_verifiy_sim_pins (void)
604 {
605         int ret;
606
607         TelSimSecPw_t pin_data;
608
609         memset (&pin_data, 0, sizeof(TelSimSecPw_t));
610
611         pin_data.type = 0;
612         pin_data.pw_len = 4;
613         pin_data.pw = calloc(1, pin_data.pw_len);
614         strcpy ((char *)pin_data.pw, "1234");
615
616         ret = tel_verifiy_sim_pins (NULL, &pin_data, NULL, NULL);
617         if (ret == TAPI_API_SUCCESS) {
618                 dts_fail("tel_verifiy_sim_pins", "Parameter check failed");
619         }
620
621         pin_data.type = 2;
622         ret = tel_verifiy_sim_pins (handle, &pin_data, NULL, NULL);
623         if (ret == TAPI_API_SUCCESS) {
624                 dts_fail("tel_verifiy_sim_pins", "Parameter check failed");
625         }
626
627         pin_data.type = 0;
628         pin_data.pw_len = 3;
629         ret = tel_verifiy_sim_pins (handle, &pin_data, NULL, NULL);
630         if (ret == TAPI_API_SUCCESS) {
631                 dts_fail("tel_verifiy_sim_pins", "Parameter check failed");
632         }
633
634         pin_data.pw_len = 9;
635         ret = tel_verifiy_sim_pins (handle, &pin_data, NULL, NULL);
636         if (ret == TAPI_API_SUCCESS) {
637                 dts_fail("tel_verifiy_sim_pins", "Parameter check failed");
638         }
639
640         ret = tel_verifiy_sim_pins (handle, NULL, NULL, NULL);
641         if (ret == TAPI_API_SUCCESS) {
642                 dts_fail("tel_verifiy_sim_pins", "Parameter check failed");
643         }
644
645         dts_pass("tel_verifiy_sim_pins");
646         free(pin_data.pw);
647 }
648
649 /**
650  * tel_verify_sim_puks
651  *
652  */
653 static void on_tel_verify_sim_puks (TapiHandle *handle, int result,
654                 void *data, void *user_data)
655 {
656         int *value = user_data;
657
658         async_flag = ASYNC_DONE;
659         util_stop_loop ();
660
661         if (*value != 0xC0FFEE) {
662                 dts_fail("tel_verify_sim_puks", "Callback userdata crashed");
663         }
664 }
665
666 static void utc_tel_verify_sim_puks (void)
667 {
668         int ret;
669         int value = 0xC0FFEE;
670         TelSimSecPw_t puk_data;
671         TelSimSecPw_t new_pin_data;
672
673         memset (&puk_data, 0, sizeof(TelSimSecPw_t));
674         memset (&new_pin_data, 0, sizeof(TelSimSecPw_t));
675
676         puk_data.type = 2;
677         puk_data.pw_len = 5;
678         puk_data.pw = calloc(1, puk_data.pw_len);
679         strcpy ((char *)puk_data.pw, "22222");
680
681         new_pin_data.type = 0;
682         new_pin_data.pw_len = 4;
683         new_pin_data.pw = calloc(1, new_pin_data.pw_len);
684         strcpy ((char *)new_pin_data.pw, "1111");
685
686         util_init_loop ();
687
688         async_flag = ASYNC_READY;
689         ret = tel_verify_sim_puks (handle, &puk_data, &new_pin_data, on_tel_verify_sim_puks, &value);
690         if (ret != TAPI_API_SUCCESS) {
691                 dts_fail("tel_verify_sim_puks", "Unexpected return");
692         }
693
694         util_start_loop ();
695         util_free_loop ();
696
697         if (async_flag != ASYNC_DONE) {
698                 dts_fail("tel_verify_sim_puks", "Callback not invoked");
699         }
700
701         dts_pass("tel_verify_sim_puks");
702         free(puk_data.pw);
703         free(new_pin_data.pw);
704 }
705
706 static void utc_fail_tel_verify_sim_puks (void)
707 {
708         int ret;
709         TelSimSecPw_t puk_data;
710         TelSimSecPw_t new_pin_data;
711
712         memset (&puk_data, 0, sizeof(TelSimSecPw_t));
713         memset (&new_pin_data, 0, sizeof(TelSimSecPw_t));
714
715         puk_data.type = 2;
716         puk_data.pw_len = 5;
717         puk_data.pw = calloc(1, puk_data.pw_len);
718         strcpy ((char *)puk_data.pw, "22222");
719
720         new_pin_data.type = 0;
721         new_pin_data.pw_len = 4;
722         new_pin_data.pw = calloc(1, new_pin_data.pw_len);
723         strcpy ((char *)new_pin_data.pw, "1111");
724
725         ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL);
726         if (ret == TAPI_API_SUCCESS) {
727                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
728         }
729         ret = tel_verify_sim_puks (NULL, NULL , &new_pin_data, NULL, NULL);
730         if (ret == TAPI_API_SUCCESS) {
731                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
732         }
733         ret = tel_verify_sim_puks (NULL, &puk_data, NULL, NULL, NULL);
734         if (ret == TAPI_API_SUCCESS) {
735                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
736         }
737         ret = tel_verify_sim_puks (NULL, NULL, NULL, NULL, NULL);
738         if (ret == TAPI_API_SUCCESS) {
739                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
740         }
741         puk_data.type = 0;
742         ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL);
743         if (ret == TAPI_API_SUCCESS) {
744                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
745         }
746         puk_data.type = 2;
747         new_pin_data.type = 2;
748         ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL);
749         if (ret == TAPI_API_SUCCESS) {
750                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
751         }
752         puk_data.type = 2;
753         new_pin_data.type = 0;
754         puk_data.pw_len = 3;
755         ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL);
756         if (ret == TAPI_API_SUCCESS) {
757                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
758         }
759         puk_data.pw_len = 9;
760         ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL);
761         if (ret == TAPI_API_SUCCESS) {
762                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
763         }
764         new_pin_data.pw_len = 3;
765         ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL);
766         if (ret == TAPI_API_SUCCESS) {
767                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
768         }
769         new_pin_data.pw_len = 9;
770         ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL);
771         if (ret == TAPI_API_SUCCESS) {
772                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
773         }
774         puk_data.pw_len = 5;
775         new_pin_data.pw_len = 5;
776         puk_data.pw = NULL;
777         ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL);
778         if (ret == TAPI_API_SUCCESS) {
779                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
780         }
781         new_pin_data.pw = NULL;
782         ret = tel_verify_sim_puks (NULL, &puk_data, &new_pin_data, NULL, NULL);
783         if (ret == TAPI_API_SUCCESS) {
784                 dts_fail("tel_verify_sim_puks", "Parameter check failed");
785         }
786
787         dts_pass("tel_verify_sim_puks");
788         free(puk_data.pw);
789         free(new_pin_data.pw);
790 }
791
792 /**
793  * tel_change_sim_pins
794  *
795  */
796 static void on_tel_change_sim_pins (TapiHandle *handle, int result,
797                 void *data, void *user_data)
798 {
799         int *value = user_data;
800
801         async_flag = ASYNC_DONE;
802         util_stop_loop ();
803
804         if (*value != 0xC0FFEE) {
805                 dts_fail("tel_change_sim_pins", "Callback userdata crashed");
806         }
807 }
808
809 static void utc_tel_change_sim_pins (void)
810 {
811         int ret;
812         int value = 0xC0FFEE;
813         TelSimSecPw_t old_pin;
814         TelSimSecPw_t new_pin;
815
816         memset (&old_pin, 0, sizeof(TelSimSecPw_t));
817         memset (&new_pin, 0, sizeof(TelSimSecPw_t));
818
819         old_pin.type = 0;
820         old_pin.pw_len = 4;
821         old_pin.pw = calloc(1, old_pin.pw_len);
822         strcpy ((char *)old_pin.pw, "1111");
823
824         new_pin.type = 0;
825         new_pin.pw_len = 4;
826         new_pin.pw = calloc(1, new_pin.pw_len);
827         strcpy ((char *)new_pin.pw, "2222");
828
829         util_init_loop ();
830
831         async_flag = ASYNC_READY;
832         ret = tel_change_sim_pins (handle, &old_pin, &new_pin, on_tel_change_sim_pins, &value);
833         if (ret != TAPI_API_SUCCESS) {
834                 dts_fail("tel_change_sim_pins", "Unexpected return");
835         }
836
837         util_start_loop ();
838         util_free_loop ();
839
840         if (async_flag != ASYNC_DONE) {
841                 dts_fail("tel_change_sim_pins", "Callback not invoked");
842         }
843
844         dts_pass("tel_change_sim_pins");
845         free(old_pin.pw);
846         free(new_pin.pw);
847 }
848
849 static void utc_fail_tel_change_sim_pins (void)
850 {
851         int ret;
852         TelSimSecPw_t old_pin;
853         TelSimSecPw_t new_pin;
854
855         memset (&old_pin, 0, sizeof(TelSimSecPw_t));
856         memset (&new_pin, 0, sizeof(TelSimSecPw_t));
857
858         old_pin.type = 0;
859         old_pin.pw_len = 4;
860         old_pin.pw = calloc(1, old_pin.pw_len);
861         strcpy ((char *)old_pin.pw, "1111");
862
863         new_pin.type = 0;
864         new_pin.pw_len = 4;
865         new_pin.pw = calloc(1, new_pin.pw_len);
866         strcpy ((char *)new_pin.pw, "2222");
867
868         ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL);
869         if (ret == TAPI_API_SUCCESS) {
870                 dts_fail("tel_change_sim_pins", "Parameter check failed");
871         }
872         ret = tel_change_sim_pins (NULL, NULL , &new_pin, NULL, NULL);
873         if (ret == TAPI_API_SUCCESS) {
874                 dts_fail("tel_change_sim_pins", "Parameter check failed");
875         }
876         ret = tel_change_sim_pins (NULL, &old_pin, NULL, NULL, NULL);
877         if (ret == TAPI_API_SUCCESS) {
878                 dts_fail("tel_change_sim_pins", "Parameter check failed");
879         }
880         ret = tel_change_sim_pins (NULL, NULL, NULL, NULL, NULL);
881         if (ret == TAPI_API_SUCCESS) {
882                 dts_fail("tel_change_sim_pins", "Parameter check failed");
883         }
884         old_pin.type = 2;
885         ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL);
886         if (ret == TAPI_API_SUCCESS) {
887                 dts_fail("tel_change_sim_pins", "Parameter check failed");
888         }
889         old_pin.type = 0;
890         new_pin.type = 2;
891         ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL);
892         if (ret == TAPI_API_SUCCESS) {
893                 dts_fail("tel_change_sim_pins", "Parameter check failed");
894         }
895         old_pin.type = 0;
896         new_pin.type = 0;
897         old_pin.pw_len = 3;
898         ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL);
899         if (ret == TAPI_API_SUCCESS) {
900                 dts_fail("tel_change_sim_pins", "Parameter check failed");
901         }
902         old_pin.pw_len = 9;
903         ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL);
904         if (ret == TAPI_API_SUCCESS) {
905                 dts_fail("tel_change_sim_pins", "Parameter check failed");
906         }
907         new_pin.pw_len = 3;
908         ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL);
909         if (ret == TAPI_API_SUCCESS) {
910                 dts_fail("tel_change_sim_pins", "Parameter check failed");
911         }
912         new_pin.pw_len = 9;
913         ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL);
914         if (ret == TAPI_API_SUCCESS) {
915                 dts_fail("tel_change_sim_pins", "Parameter check failed");
916         }
917         old_pin.pw_len = 4;
918         new_pin.pw_len = 4;
919         old_pin.pw = NULL;
920         ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL);
921         if (ret == TAPI_API_SUCCESS) {
922                 dts_fail("tel_change_sim_pins", "Parameter check failed");
923         }
924         new_pin.pw = NULL;
925         ret = tel_change_sim_pins (NULL, &old_pin, &new_pin, NULL, NULL);
926         if (ret == TAPI_API_SUCCESS) {
927                 dts_fail("tel_change_sim_pins", "Parameter check failed");
928         }
929
930         dts_pass("tel_change_sim_pins");
931         free(old_pin.pw);
932         free(new_pin.pw);
933 }
934
935 /**
936  * tel_disable_sim_facility
937  *
938  */
939 static void on_tel_disable_sim_facility (TapiHandle *handle, int result,
940                 void *data, void *user_data)
941 {
942         int *value = user_data;
943
944         async_flag = ASYNC_DONE;
945         util_stop_loop ();
946
947         if (*value != 0xC0FFEE) {
948                 dts_fail("tel_disable_sim_facility", "Callback userdata crashed");
949         }
950 }
951
952 static void utc_tel_disable_sim_facility (void)
953 {
954         int ret;
955         int value = 0xC0FFEE;
956         TelSimFacilityPw_t pw;
957
958         memset (&pw, 0, sizeof(TelSimFacilityPw_t));
959
960         pw.lock_type = 1;
961         pw.pw_len = 5;
962         pw.pw = calloc(1, pw.pw_len);
963         strcpy ((char *)pw.pw, "12345");
964
965         util_init_loop ();
966
967         async_flag = ASYNC_READY;
968         ret = tel_disable_sim_facility (handle, &pw, on_tel_disable_sim_facility, &value);
969         if (ret != TAPI_API_SUCCESS) {
970                 dts_fail("tel_disable_sim_facility", "Unexpected return");
971         }
972
973         util_start_loop ();
974         util_free_loop ();
975
976         if (async_flag != ASYNC_DONE) {
977                 dts_fail("tel_disable_sim_facility", "Callback not invoked");
978         }
979
980         dts_pass("tel_disable_sim_facility");
981         free(pw.pw);
982 }
983
984 static void utc_fail_tel_disable_sim_facility (void)
985 {
986         int ret;
987         TelSimFacilityPw_t pw;
988
989         memset (&pw, 0, sizeof(TelSimFacilityPw_t));
990
991         pw.lock_type = 1;
992         pw.pw_len = 5;
993         pw.pw = calloc(1, pw.pw_len);
994         strcpy ((char *)pw.pw, "12345");
995
996         ret = tel_disable_sim_facility (NULL, &pw, NULL, NULL);
997         if (ret == TAPI_API_SUCCESS) {
998                 dts_fail("tel_disable_sim_facility", "Parameter check failed");
999         }
1000
1001         ret = tel_disable_sim_facility (handle, NULL, NULL, NULL);
1002         if (ret == TAPI_API_SUCCESS) {
1003                 dts_fail("tel_disable_sim_facility", "Parameter check failed");
1004         }
1005
1006         pw.lock_type = 0;
1007         ret = tel_disable_sim_facility (handle, &pw, NULL, NULL);
1008         if (ret == TAPI_API_SUCCESS) {
1009                 dts_fail("tel_disable_sim_facility", "Parameter check failed");
1010         }
1011
1012         pw.lock_type = 9;
1013         ret = tel_disable_sim_facility (handle, &pw, NULL, NULL);
1014         if (ret == TAPI_API_SUCCESS) {
1015                 dts_fail("tel_disable_sim_facility", "Parameter check failed");
1016         }
1017
1018         pw.lock_type = 1;
1019         pw.pw = NULL;
1020         ret = tel_disable_sim_facility (handle, &pw, NULL, NULL);
1021         if (ret == TAPI_API_SUCCESS) {
1022                 dts_fail("tel_disable_sim_facility", "Parameter check failed");
1023         }
1024
1025         dts_pass("tel_disable_sim_facility");
1026         free(pw.pw);
1027 }
1028
1029 /**
1030  * tel_enable_sim_facility
1031  *
1032  */
1033 static void on_tel_enable_sim_facility (TapiHandle *handle, int result,
1034                 void *data, void *user_data)
1035 {
1036         int *value = user_data;
1037
1038         async_flag = ASYNC_DONE;
1039         util_stop_loop ();
1040
1041         if (*value != 0xC0FFEE) {
1042                 dts_fail("tel_enable_sim_facility", "Callback userdata crashed");
1043         }
1044 }
1045
1046 static void utc_tel_enable_sim_facility (void)
1047 {
1048         int ret;
1049         int value = 0xC0FFEE;
1050         TelSimFacilityPw_t pw;
1051
1052         memset (&pw, 0, sizeof(TelSimFacilityPw_t));
1053
1054         pw.lock_type = 1;
1055         pw.pw_len = 5;
1056         pw.pw = calloc(1, pw.pw_len);
1057         strcpy ((char *)pw.pw, "12345");
1058
1059         util_init_loop ();
1060
1061         async_flag = ASYNC_READY;
1062         ret = tel_enable_sim_facility (handle, &pw, on_tel_enable_sim_facility, &value);
1063         if (ret != TAPI_API_SUCCESS) {
1064                 dts_fail("tel_enable_sim_facility", "Unexpected return");
1065         }
1066
1067         util_start_loop ();
1068         util_free_loop ();
1069
1070         if (async_flag != ASYNC_DONE) {
1071                 dts_fail("tel_enable_sim_facility", "Callback not invoked");
1072         }
1073
1074         dts_pass("tel_enable_sim_facility");
1075         free(pw.pw);
1076 }
1077
1078 static void utc_fail_tel_enable_sim_facility (void)
1079 {
1080         int ret;
1081         TelSimFacilityPw_t pw;
1082
1083         memset (&pw, 0, sizeof(TelSimFacilityPw_t));
1084
1085         pw.lock_type = 1;
1086         pw.pw_len = 5;
1087         pw.pw = calloc(1, pw.pw_len);
1088         strcpy ((char *)pw.pw, "12345");
1089
1090         ret = tel_enable_sim_facility (NULL, &pw, NULL, NULL);
1091         if (ret == TAPI_API_SUCCESS) {
1092                 dts_fail("tel_enable_sim_facility", "Parameter check failed");
1093         }
1094
1095         ret = tel_enable_sim_facility (handle, NULL, NULL, NULL);
1096         if (ret == TAPI_API_SUCCESS) {
1097                 dts_fail("tel_enable_sim_facility", "Parameter check failed");
1098         }
1099
1100         pw.lock_type = 0;
1101         ret = tel_enable_sim_facility (handle, &pw, NULL, NULL);
1102         if (ret == TAPI_API_SUCCESS) {
1103                 dts_fail("tel_enable_sim_facility", "Parameter check failed");
1104         }
1105
1106         pw.lock_type = 9;
1107         ret = tel_enable_sim_facility (handle, &pw, NULL, NULL);
1108         if (ret == TAPI_API_SUCCESS) {
1109                 dts_fail("tel_enable_sim_facility", "Parameter check failed");
1110         }
1111
1112         pw.lock_type = 1;
1113         pw.pw = NULL;
1114         ret = tel_enable_sim_facility (handle, &pw, NULL, NULL);
1115         if (ret == TAPI_API_SUCCESS) {
1116                 dts_fail("tel_enable_sim_facility", "Parameter check failed");
1117         }
1118
1119         dts_pass("tel_enable_sim_facility");
1120         free(pw.pw);
1121 }
1122
1123 /**
1124  * tel_get_sim_facility
1125  *
1126  */
1127 static void on_tel_get_sim_facility (TapiHandle *handle, int result,
1128                 void *data, void *user_data)
1129 {
1130         int *value = user_data;
1131
1132         async_flag = ASYNC_DONE;
1133         util_stop_loop ();
1134
1135         if (*value != 0xC0FFEE) {
1136                 dts_fail("tel_get_sim_facility", "Callback userdata crashed");
1137         }
1138 }
1139
1140 static void utc_tel_get_sim_facility (void)
1141 {
1142         int ret;
1143         int value = 0xC0FFEE;
1144
1145         util_init_loop ();
1146
1147         async_flag = ASYNC_READY;
1148         ret = tel_get_sim_facility (handle, 3, on_tel_get_sim_facility, &value);
1149         if (ret != TAPI_API_SUCCESS) {
1150                 dts_fail("tel_get_sim_facility", "Unexpected return");
1151         }
1152
1153         util_start_loop ();
1154         util_free_loop ();
1155
1156         if (async_flag != ASYNC_DONE) {
1157                 dts_fail("tel_get_sim_facility", "Callback not invoked");
1158         }
1159
1160         dts_pass("tel_get_sim_facility");
1161 }
1162
1163 static void utc_fail_tel_get_sim_facility (void)
1164 {
1165         int ret;
1166
1167         ret = tel_get_sim_facility (NULL, 3, NULL, NULL);
1168         if (ret == TAPI_API_SUCCESS) {
1169                 dts_fail("tel_get_sim_facility", "Parameter check failed");
1170         }
1171
1172         ret = tel_get_sim_facility (handle, 0, NULL, NULL);
1173         if (ret == TAPI_API_SUCCESS) {
1174                 dts_fail("tel_get_sim_facility", "Parameter check failed");
1175         }
1176
1177         ret = tel_get_sim_facility (handle, 9, NULL, NULL);
1178         if (ret == TAPI_API_SUCCESS) {
1179                 dts_fail("tel_get_sim_facility", "Parameter check failed");
1180         }
1181
1182         dts_pass("tel_get_sim_facility");
1183 }
1184
1185 /**
1186  * tel_get_sim_lock_info
1187  *
1188  */
1189 static void on_tel_get_sim_lock_info (TapiHandle *handle, int result,
1190                 void *data, void *user_data)
1191 {
1192         int *value = user_data;
1193
1194         async_flag = ASYNC_DONE;
1195         util_stop_loop ();
1196
1197         if (*value != 0xC0FFEE) {
1198                 dts_fail("tel_get_sim_lock_info", "Callback userdata crashed");
1199         }
1200 }
1201
1202 static void utc_tel_get_sim_lock_info (void)
1203 {
1204         int ret;
1205         int value = 0xC0FFEE;
1206
1207         util_init_loop ();
1208
1209         async_flag = ASYNC_READY;
1210         ret = tel_get_sim_lock_info (handle, 3, on_tel_get_sim_lock_info, &value);
1211         if (ret != TAPI_API_SUCCESS) {
1212                 dts_fail("tel_get_sim_lock_info", "Unexpected return");
1213         }
1214
1215         util_start_loop ();
1216         util_free_loop ();
1217
1218         if (async_flag != ASYNC_DONE) {
1219                 dts_fail("tel_get_sim_lock_info", "Callback not invoked");
1220         }
1221
1222         dts_pass("tel_get_sim_lock_info");
1223 }
1224
1225 static void utc_fail_tel_get_sim_lock_info (void)
1226 {
1227         int ret;
1228
1229         ret = tel_get_sim_lock_info (NULL, 3, NULL, NULL);
1230         if (ret == TAPI_API_SUCCESS) {
1231                 dts_fail("tel_get_sim_facility", "Parameter check failed");
1232         }
1233
1234         ret = tel_get_sim_lock_info (handle, 0, NULL, NULL);
1235         if (ret == TAPI_API_SUCCESS) {
1236                 dts_fail("tel_get_sim_lock_info", "Parameter check failed");
1237         }
1238
1239         ret = tel_get_sim_lock_info (handle, 9, NULL, NULL);
1240         if (ret == TAPI_API_SUCCESS) {
1241                 dts_fail("tel_get_sim_lock_info", "Parameter check failed");
1242         }
1243
1244         dts_pass("tel_get_sim_lock_info");
1245 }
1246
1247 /**
1248  * tel_req_sim_apdu
1249  *
1250  */
1251 static void on_tel_req_sim_apdu (TapiHandle *handle, int result,
1252                 void *data, void *user_data)
1253 {
1254         int *value = user_data;
1255
1256         async_flag = ASYNC_DONE;
1257         util_stop_loop ();
1258
1259         if (*value != 0xC0FFEE) {
1260                 dts_fail("tel_req_sim_apdu", "Callback userdata crashed");
1261         }
1262 }
1263
1264 static void utc_tel_req_sim_apdu (void)
1265 {
1266         int ret;
1267         int value = 0xC0FFEE;
1268         TelSimApdu_t apdu_data;
1269
1270         memset (&apdu_data, 0, sizeof(TelSimApdu_t));
1271
1272         apdu_data.apdu_len = 7;
1273         apdu_data.apdu = calloc(1, apdu_data.apdu_len);
1274         strcpy ((char *)apdu_data.apdu, "a0a40000026f02");
1275
1276         util_init_loop ();
1277
1278         async_flag = ASYNC_READY;
1279         ret = tel_req_sim_apdu (handle, &apdu_data, on_tel_req_sim_apdu, &value);
1280         if (ret != TAPI_API_SUCCESS) {
1281                 dts_fail("tel_req_sim_apdu", "Unexpected return");
1282         }
1283
1284         util_start_loop ();
1285         util_free_loop ();
1286
1287         if (async_flag != ASYNC_DONE) {
1288                 dts_fail("tel_req_sim_apdu", "Callback not invoked");
1289         }
1290
1291         dts_pass("tel_req_sim_apdu");
1292         free(apdu_data.apdu);
1293 }
1294
1295 static void utc_fail_tel_req_sim_apdu (void)
1296 {
1297         int ret;
1298         TelSimApdu_t apdu_data;
1299
1300         memset (&apdu_data, 0, sizeof(TelSimApdu_t));
1301
1302         apdu_data.apdu_len = 7;
1303         apdu_data.apdu = calloc(1, apdu_data.apdu_len);
1304         strcpy ((char *)apdu_data.apdu, "a0a40000026f02");
1305
1306         ret = tel_req_sim_apdu (NULL, &apdu_data, NULL, NULL);
1307         if (ret == TAPI_API_SUCCESS) {
1308                 dts_fail("tel_req_sim_apdu", "Parameter check failed");
1309         }
1310
1311         ret = tel_req_sim_apdu (handle, NULL, NULL, NULL);
1312         if (ret == TAPI_API_SUCCESS) {
1313                 dts_fail("tel_req_sim_apdu", "Parameter check failed");
1314         }
1315
1316         apdu_data.apdu = NULL;
1317         ret = tel_req_sim_apdu (handle, &apdu_data, NULL, NULL);
1318         if (ret == TAPI_API_SUCCESS) {
1319                 dts_fail("tel_req_sim_apdu", "Parameter check failed");
1320         }
1321
1322         dts_pass("tel_req_sim_apdu");
1323         free(apdu_data.apdu);
1324 }
1325
1326 /**
1327  * Generate default TC for no-additional-parameter type API
1328  *
1329  */
1330 DO(tel_get_sim_iccid)
1331 DO(tel_get_sim_language)
1332 DO(tel_get_sim_callforwarding_info)
1333 DO(tel_get_sim_messagewaiting_info)
1334 DO(tel_get_sim_mailbox_info)
1335 DO(tel_get_sim_cphs_info)
1336 DO(tel_get_sim_service_table)
1337 DO(tel_get_sim_msisdn)
1338 DO(tel_get_sim_oplmnwact)
1339 DO(tel_get_sim_spn)
1340 DO(tel_get_sim_cphs_netname)
1341 DO(tel_req_sim_atr)
1342
1343 struct tet_testlist tet_testlist[] = {
1344         /* generated TC */
1345         { utc_tel_get_sim_iccid, 1 },
1346         { utc_fail_tel_get_sim_iccid, 2 },
1347         { utc_tel_get_sim_language, 1 },
1348         { utc_fail_tel_get_sim_language, 2 },
1349         { utc_tel_get_sim_callforwarding_info, 1 },
1350         { utc_fail_tel_get_sim_callforwarding_info, 2 },
1351         { utc_tel_get_sim_messagewaiting_info, 1 },
1352         { utc_fail_tel_get_sim_messagewaiting_info, 2 },
1353         { utc_tel_get_sim_mailbox_info, 1 },
1354         { utc_fail_tel_get_sim_mailbox_info, 2 },
1355         { utc_tel_get_sim_cphs_info, 1 },
1356         { utc_fail_tel_get_sim_cphs_info, 2 },
1357         { utc_tel_get_sim_service_table, 1 },
1358         { utc_fail_tel_get_sim_service_table, 2 },
1359         { utc_tel_get_sim_msisdn, 1 },
1360         { utc_fail_tel_get_sim_msisdn, 2 },
1361         { utc_tel_get_sim_oplmnwact, 1 },
1362         { utc_fail_tel_get_sim_oplmnwact, 2 },
1363         { utc_tel_get_sim_spn, 1 },
1364         { utc_fail_tel_get_sim_spn, 2 },
1365         { utc_tel_get_sim_cphs_netname, 1 },
1366         { utc_fail_tel_get_sim_cphs_netname, 2 },
1367         { utc_tel_req_sim_atr, 1 },
1368         { utc_fail_tel_req_sim_atr, 2 },
1369         /* custom TC */
1370         { utc_tel_get_sim_init_info, 1 },
1371         { utc_fail_tel_get_sim_init_info, 2 },
1372         { utc_tel_get_sim_type, 1 },
1373         { utc_fail_tel_get_sim_type, 2 },
1374         { utc_tel_get_sim_imsi, 1 },
1375         { utc_fail_tel_get_sim_imsi, 2 },
1376         { utc_tel_get_sim_ecc, 1 },
1377         { utc_fail_tel_get_sim_ecc, 2 },
1378         { utc_tel_set_sim_language, 1 },
1379         { utc_fail_tel_set_sim_language, 2 },
1380         { utc_tel_set_sim_callforwarding_info, 1 },
1381         { utc_fail_tel_set_sim_callforwarding_info, 2 },
1382         { utc_tel_set_sim_messagewaiting_info, 1 },
1383         { utc_fail_tel_set_sim_messagewaiting_info, 2 },
1384         { utc_tel_set_sim_mailbox_info, 1 },
1385         { utc_fail_tel_set_sim_mailbox_info, 2 },
1386         { utc_tel_req_sim_authentication, 1 },
1387         { utc_fail_tel_req_sim_authentication, 2 },
1388         { utc_tel_verifiy_sim_pins, 1 },
1389         { utc_fail_tel_verifiy_sim_pins, 2 },
1390         { utc_tel_verify_sim_puks, 1 },
1391         { utc_fail_tel_verify_sim_puks, 2 },
1392         { utc_tel_change_sim_pins, 1 },
1393         { utc_fail_tel_change_sim_pins, 2 },
1394         { utc_tel_disable_sim_facility, 1 },
1395         { utc_fail_tel_disable_sim_facility, 2 },
1396         { utc_tel_enable_sim_facility, 1 },
1397         { utc_fail_tel_enable_sim_facility, 2 },
1398         { utc_tel_get_sim_facility, 1 },
1399         { utc_fail_tel_get_sim_facility, 2 },
1400         { utc_tel_get_sim_lock_info, 1 },
1401         { utc_fail_tel_get_sim_lock_info, 2 },
1402         { utc_tel_req_sim_apdu, 1 },
1403         { utc_fail_tel_req_sim_apdu, 2 },
1404         { NULL, 0 },
1405 };
1406 static void startup (void)
1407 {
1408         /* start of TC */
1409         tet_printf ("\n TC start");
1410
1411         handle = tel_init (NULL);
1412 }
1413
1414 static void cleanup (void)
1415 {
1416         tel_deinit (handle);
1417
1418         /* end of TC */
1419         tet_printf ("\n TC end");
1420 }
1421
1422 void (*tet_startup) (void) = startup;
1423 void (*tet_cleanup) (void) = cleanup;