Remove unnecessary setting
[platform/core/connectivity/nfc-manager-neard.git] / tests / main.c
1 /*
2  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *                               http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <string.h>
18 #include <glib.h>
19 #include <glib-object.h>
20
21 #include "net_nfc.h"
22
23 #include "net_nfc_test_client.h"
24 #include "net_nfc_test_llcp.h"
25 #include "net_nfc_test_snep.h"
26 #include "net_nfc_test_manager.h"
27 #include "net_nfc_test_tag.h"
28 #include "net_nfc_test_ndef.h"
29 #include "net_nfc_test_p2p.h"
30 #include "net_nfc_test_handover.h"
31 #include "net_nfc_test_transceive.h"
32 #include "net_nfc_test_jewel.h"
33 #include "net_nfc_test_tag_mifare.h"
34 #include "net_nfc_test_tag_felica.h"
35 #include "net_nfc_test_se.h"
36 #include "net_nfc_test_sys_handler.h"
37
38
39 typedef struct _TestData TestData;
40
41 struct _TestData
42 {
43         gchar *interface;
44         gchar *name;
45         GFunc func;
46         GFunc func_sync;
47         gchar *comment;
48 };
49
50 static TestData test_data[] = {
51         {
52                 "Manager",
53                 "SetActive",
54                 net_nfc_test_manager_set_active,
55                 net_nfc_test_manager_set_active_sync,
56                 "Set activation",
57         },
58
59         {
60                 "Manager",
61                 "GetServerState",
62                 net_nfc_test_manager_get_server_state,
63                 net_nfc_test_manager_get_server_state_sync,
64                 "Get server state"
65         },
66
67         {
68                 "Client",
69                 "ClientInitialize",
70                 net_nfc_test_initialize,
71                 NULL,
72                 "Start Client Initialization"
73         },
74
75         {
76                 "Client",
77                 "ClientDeinitialize",
78                 net_nfc_test_deinitialize,
79                 NULL,
80                 "Start Client Deinitialization"
81         },
82
83         {
84                 "Client",
85                 "ClientIsNfcSupported",
86                 net_nfc_test_is_nfc_supported,
87                 NULL,
88                 "Get is nfc supported"
89         },
90
91         {
92                 "Client",
93                 "ClientGetNfcState",
94                 net_nfc_test_get_nfc_state,
95                 NULL,
96                 "Get nfc state"
97         },
98 #if 0
99         {
100                 "Tag",
101                 "IsTagConnected",
102                 net_nfc_test_tag_is_tag_connected,
103                 net_nfc_test_tag_is_tag_connected_sync,
104                 "Get is tag connected"
105         },
106         {
107                 "Tag",
108                 "GetCurrentTagInfo",
109                 net_nfc_test_tag_get_current_tag_info,
110                 net_nfc_test_tag_get_current_tag_info_sync,
111                 "Get current tag info"
112         },
113
114         {
115                 "Tag",
116                 "GetCurrentTargetHandle",
117                 net_nfc_test_tag_get_current_target_handle,
118                 net_nfc_test_tag_get_current_target_handle_sync,
119                 "Get current target handle id"
120         },
121 #endif
122         {
123                 "Tag",
124                 "TagDiscovered",                /* waiting for signal */
125                 net_nfc_test_tag_set_tag_discovered,
126                 NULL,
127                 "Waiting for TagDiscoved signal"
128         },
129
130         {
131                 "Tag",
132                 "SetFilter",
133                 net_nfc_test_tag_set_filter,
134                 NULL,
135                 "Set Tag filter"
136         },
137
138         {
139                 "Tag",
140                 "GetFilter",
141                 net_nfc_test_tag_get_filter,
142                 NULL,
143                 "Get Tag filter"
144         },
145
146
147         {
148                 "Tag",
149                 "TagDetached",          /* waiting for signal */
150                 net_nfc_test_tag_set_tag_detached,
151                 NULL,
152                 "Waiting for TagDetached signal"
153         },
154
155         {
156                 "Ndef",
157                 "Read",
158                 net_nfc_test_ndef_read,
159                 net_nfc_test_ndef_read_sync,
160                 "Read NDEF",
161         },
162
163         {
164                 "Ndef",
165                 "Write",
166                 net_nfc_test_ndef_write,
167                 net_nfc_test_ndef_write_sync,
168                 "Write NDEF"
169         },
170
171         {
172                 "Ndef",
173                 "Format",
174                 net_nfc_test_ndef_format,
175                 net_nfc_test_ndef_format_sync,
176                 "Format NDEF"
177         },
178
179         {
180                 "Ndef",
181                 "MakeReadOnly",
182                 net_nfc_test_ndef_make_read_only,
183                 net_nfc_test_ndef_make_read_only_sync,
184                 "Make Tag Read only"
185         },
186
187         {
188                 "p2p",
189                 "Send",
190                 net_nfc_test_p2p_send,
191                 net_nfc_test_p2p_send_sync,
192                 "P2P Send"
193
194         },
195
196         {
197                 "p2p",
198                 "Discovered",           /* waiting for signal*/
199                 net_nfc_test_p2p_set_device_discovered,
200                 NULL,
201                 "Waiting for  Device Discovered Signal"
202         },
203
204         {
205                 "p2p",
206                 "Detached",             /* waiting for signal*/
207                 net_nfc_test_p2p_set_device_detached,
208                 NULL,
209                 "Waiting for  Device Detached Signal"
210         },
211
212         {
213                 "p2p",
214                 "Received",             /* waiting for signal*/
215                 net_nfc_test_p2p_set_data_received,
216                 NULL,
217                 "Waiting for Device Data Received Signal"
218         },
219
220         {
221                 "Transceive",
222                 "TransceiveData",
223                 net_nfc_test_transceive_data,
224                 net_nfc_test_transceive_data_sync,
225                 "Tansceive data method call "
226         },
227
228         {
229                 "Transceive",
230                 "Transceive",
231                 net_nfc_test_transceive,
232                 net_nfc_test_transceive_sync,
233                 "Tansceive method call"
234         },
235
236         {
237                 "Handover",
238                 "BTRequest",
239                 net_nfc_test_p2p_connection_handover_with_BT,
240                 net_nfc_test_p2p_connection_handover_with_BT_sync,
241                 "Handover Request Call"
242
243         },
244
245         {
246                 "Handover",
247                 "WIFIRequest",
248                 net_nfc_test_p2p_connection_handover_with_WIFI,
249                 net_nfc_test_p2p_connection_handover_with_WIFI_sync,
250                 "Handover Request Call"
251
252         },
253
254         {
255                 "Handover",
256                 "GetCarrierType",
257                 net_nfc_test_handover_get_alternative_carrier_type,
258                 NULL,
259                 "Get Handover Carrier Type"
260
261         },
262
263         {
264                 "Handover",
265                 "HandleCarrierData",
266                 net_nfc_test_handover_handle_alternative_carrier_data,
267                 NULL,
268                 "Create/Free Handover Carrier Data"
269
270         },
271
272         {
273                 "JewelTag",
274                 "ReadId",
275                 net_nfc_test_tag_jewel_read_id,
276                 NULL,
277                 "Jewel Read id"
278
279         },
280
281         {
282                 "JewelTag",
283                 "ReadByte",
284                 net_nfc_test_tag_jewel_read_byte,
285                 NULL,
286                 "Jewel Read Byte"
287
288         },
289
290         {
291                 "JewelTag",
292                 "ReadAll",
293                 net_nfc_test_tag_jewel_read_all,
294                 NULL,
295                 "Jewel Read All"
296
297         },
298
299         {
300                 "JewelTag",
301                 "WriteWithErase",
302                 net_nfc_test_tag_jewel_write_with_erase,
303                 NULL,
304                 "Jewel Write With Erase"
305
306         },
307
308         {
309                 "JewelTag",
310                 "WriteWithNoErase",
311                 net_nfc_test_tag_jewel_write_with_no_erase,
312                 NULL,
313                 "Jewel Write With No Erase"
314
315         },
316
317         {
318                 "MifareTag",
319                 "Read",
320                 net_nfc_test_tag_mifare_read,
321                 NULL,
322                 "Read Mifare Tag"
323         },
324
325         {
326                 "MifareTag",
327                 "WriteBlock",
328                 net_nfc_test_tag_mifare_write_block,
329                 NULL,
330                 "Write data block"
331         },
332
333         {
334                 "MifareTag",
335                 "WritePage",
336                 net_nfc_test_tag_mifare_write_page,
337                 NULL,
338                 "Write Page Data"
339         },
340
341         {
342                 "MifareTag",
343                 "Increment",
344                 net_nfc_test_tag_mifare_increment,
345                 NULL,
346                 "Increment block value"
347         },
348
349         {
350                 "MifareTag",
351                 "Decrement",
352                 net_nfc_test_tag_mifare_decrement,
353                 NULL,
354                 "Decrement block value"
355         },
356
357         {
358                 "MifareTag",
359                 "Transfer",
360                 net_nfc_test_tag_mifare_transfer,
361                 NULL,
362                 " Data Transfer"
363         },
364
365         {
366                 "MifareTag",
367                 "Restore",
368                 net_nfc_test_tag_mifare_restore,
369                 NULL,
370                 "Data Restore"
371         },
372
373         {
374                 "MifareTag",
375                 "AuthKeyA",
376                 net_nfc_test_tag_mifare_authenticate_with_keyA,
377                 NULL,
378                 "Authenticate with key A"
379         },
380
381         {
382                 "MifareTag",
383                 "AuthKeyB",
384                 net_nfc_test_tag_mifare_authenticate_with_keyB,
385                 NULL,
386                 "Authenticate with key B"
387         },
388
389         {
390                 "FelicaTag",
391                 "FelicaPoll",
392                 net_nfc_test_felica_poll,
393                 NULL,
394                 "Felica Poll"
395         },
396
397         {
398                 "FelicaTag",
399                 "FelicaRequestService",
400                 net_nfc_test_felica_request_service,
401                 NULL,
402                 "Felica Request Service"
403         },
404
405         {
406                 "FelicaTag",
407                 "FelicaRequestResponse",
408                 net_nfc_test_felica_request_response,
409                 NULL,
410                 "Felica Request Response"
411         },
412
413         {
414                 "FelicaTag",
415                 "FelicaReadWithoutEncryption",
416                 net_nfc_test_felica_read_without_encryption,
417                 NULL,
418                 "Felica Read Without Encryption"
419         },
420
421         {
422                 "FelicaTag",
423                 "FelicaWriteWithoutEncryption",
424                 net_nfc_test_felica_write_without_encryption,
425                 NULL,
426                 "Felica Write Without Encryption"
427         },
428
429         {
430                 "FelicaTag",
431                 "FelicaRequestSystemCode",
432                 net_nfc_test_felica_request_system_code,
433                 NULL,
434                 "Felica Request System Code"
435         },
436
437         {
438                 "llcp",
439                 "GetConfigWKS",
440                 net_nfc_test_llcp_get_config_wks,
441                 NULL,
442                 "Get the Config of WKS"
443         },
444
445
446         {
447                 "llcp",
448                 "GetConfigLTO",
449                 net_nfc_test_llcp_get_config_lto,
450                 NULL,
451                 "Get the Config of LTO"
452         },
453
454
455         {
456                 "llcp",
457                 "GetConfigMIU",
458                 net_nfc_test_llcp_get_config_miu,
459                 NULL,
460                 "Get the Config of MIU"
461         },
462
463         {
464                 "llcp",
465                 "GetConfigOption",
466                 net_nfc_test_llcp_get_config_option,
467                 NULL,
468                 "Get the Config Option Type"
469         },
470
471         {
472                 "llcp",
473                 "SetConfigWKS",
474                 net_nfc_test_llcp_set_config_wks,
475                 NULL,
476                 "Set the Config for WKS"
477         },
478
479
480         {
481                 "llcp",
482                 "SetConfigLTO",
483                 net_nfc_test_llcp_set_config_lto,
484                 NULL,
485                 "Set the Config for LTO"
486         },
487
488
489         {
490                 "llcp",
491                 "SetConfigMIU",
492                 net_nfc_test_llcp_set_config_miu,
493                 NULL,
494                 "Set the Config for MIU"
495         },
496
497         {
498                 "llcp",
499                 "SetConfigOption",
500                 net_nfc_test_llcp_set_config_option,
501                 NULL,
502                 "Set the Config Option Type"
503         },
504
505         {
506                 "llcp",
507                 "FreeConfig",
508                 net_nfc_test_llcp_free_config,
509                 NULL,
510                 "Clear the llcp configuration options"
511         },
512
513
514         {
515                 "llcp",
516                 "CreateCustomSocketOption",
517                 net_nfc_test_llcp_create_custom_socket_option,
518                 NULL,
519                 "Create Custom Socket Option"
520         },
521
522         {
523                 "llcp",
524                 "CreateDefaultSocketOption",
525                 net_nfc_test_llcp_create_default_socket_option,
526                 NULL,
527                 "Create Default Socket Option"
528         },
529
530
531         {
532                 "llcp",
533                 "GetLocalSocketOption",
534                 net_nfc_test_llcp_get_local_socket_option,
535                 NULL,
536                 "Get Local Socket Option"
537         },
538
539
540         {
541                 "llcp",
542                 "GetLocalSocketMIU",
543                 net_nfc_test_llcp_get_socket_option_miu,
544                 NULL,
545                 "Get Local Socket MIU"
546         },
547
548
549         {
550                 "llcp",
551                 "GetLocalSocketRW",
552                 net_nfc_test_llcp_get_socket_option_rw,
553                 NULL,
554                 "Get Local Socket RW"
555         },
556
557
558         {
559                 "llcp",
560                 "GetLocalSocketOptionType",
561                 net_nfc_test_llcp_get_socket_option_type,
562                 NULL,
563                 "Get Local Socket Option Type"
564         },
565
566         {
567                 "llcp",
568                 "SetLocalSocketMIU",
569                 net_nfc_test_llcp_set_socket_option_miu,
570                 NULL,
571                 "Set Local Socket MIU"
572         },
573
574
575         {
576                 "llcp",
577                 "SetLocalSocketRW",
578                 net_nfc_test_llcp_set_socket_option_rw,
579                 NULL,
580                 "Set Local Socket RW"
581         },
582
583
584         {
585                 "llcp",
586                 "SetLocalSocketOptionType",
587                 net_nfc_test_llcp_set_socket_option_type,
588                 NULL,
589                 "Set Local Socket Option Type"
590         },
591
592         {
593                 "llcp",
594                 "FreeSocketOption",
595                 net_nfc_test_llcp_free_socket_option,
596                 NULL,
597                 "Free Socket Option"
598         },
599
600         {
601                 "llcp",
602                 "ListenToSocket",
603                 net_nfc_test_llcp_listen,
604                 net_nfc_test_llcp_listen_sync,
605                 "Listen To Server Socket"
606         },
607
608         {
609                 "llcp",
610                 "ReceiveSocket",
611                 net_nfc_test_llcp_receive,
612                 net_nfc_test_llcp_receive_sync,
613                 "Receive data from socket "
614         },
615
616         {
617                 "llcp",
618                 "ReceiveFromSocket",
619                 net_nfc_test_llcp_receive_from,
620                 net_nfc_test_llcp_receive_from_sync,
621                 "Receive data from socket (sap data also included)"
622         },
623
624         {
625                 "llcp",
626                 "ConnectToSocket",
627                 net_nfc_test_llcp_connect,
628                 net_nfc_test_llcp_connect_sync,
629                 "Connect to a socket"
630         },
631
632         {
633                 "llcp",
634                 "ConnectToSapSocket",
635                 net_nfc_test_llcp_connect_sap,
636                 net_nfc_test_llcp_connect_sap_sync,
637                 "Connect to a specific SAP on the socket"
638         },
639
640         {
641                 "llcp",
642                 "SendToSocket",
643                 net_nfc_test_llcp_send,
644                 net_nfc_test_llcp_send_sync,
645                 "Send Data to a socket"
646         },
647
648         {
649                 "llcp",
650                 "SendToSapSocket",
651                 net_nfc_test_llcp_send_to,
652                 net_nfc_test_llcp_send_to_sync,
653                 "Send data to a specific SAP on the socket"
654         },
655
656         {
657                 "llcp",
658                 "DisconnectSocket",
659                 net_nfc_test_llcp_disconnect,
660                 net_nfc_test_llcp_disconnect_sync,
661                 "Disconnects the client socket"
662         },
663
664         {
665                 "llcp",
666                 "DisconnectOtherSockets",
667                 net_nfc_test_llcp_disconnect_server,
668                 NULL,
669                 "Disconnects the Server and Accepted sockets"
670         },
671
672         {
673                 "snep",
674                 "SNEPTagDiscovery",
675                 net_nfc_test_snep_set_tag_discovered,
676                 NULL,
677                 "Discovers the tag/target before starting SNEP operation"
678         },
679
680         {
681                 "snep",
682                 "SNEPP2PDeviceDiscovery",
683                 net_nfc_test_snep_set_p2p_device_discovered,
684                 NULL,
685                 "Discover the P2P device for snep operation"
686         },
687
688         {
689                 "snep",
690                 "StartSNEPServer",
691                 net_nfc_test_snep_start_server,
692                 net_nfc_test_snep_start_server_sync,
693                 "Starts the SNEP server"
694         },
695
696         {
697                 "snep",
698                 "StartSNEPClient",
699                 net_nfc_test_snep_start_client,
700                 NULL,
701                 "Starts the SNEP client"
702         },
703
704         {
705                 "snep",
706                 "SendClientRequest",
707                 net_nfc_test_snep_send_client_request,
708                 NULL,
709                 "Sends the SNEP client Request"
710         },
711
712         {
713                 "snep",
714                 "RegisterServer",
715                 net_nfc_test_snep_register_server,
716                 NULL,
717                 "Registers the SNEP server"
718         },
719
720         {
721                 "snep",
722                 "UnRegisterServer",
723                 net_nfc_test_snep_unregister_server,
724                 NULL,
725                 "UnRegisters the SNEP server"
726         },
727
728         {
729                 "snep",
730                 "ServerRegisterUnregister",
731                 net_nfc_test_snep_register_unregister_server,
732                 NULL,
733                 "Registers and UnRegisters the SNEP server"
734         },
735
736         {
737                 "snep",
738                 "StopService",
739                 net_nfc_test_snep_stop_service_sync,
740                 NULL,
741                 "Registers and UnRegisters the SNEP server"
742         },
743
744         {
745                 "SE",
746                 "SendApdu",
747                 net_nfc_test_se_send_apdu,
748                 net_nfc_test_se_send_apdu_sync,
749                 "Secure element send apdu data"
750         },
751
752         {
753                 "SE",
754                 "SetType",
755                 net_nfc_test_se_set_secure_element_type,
756                 net_nfc_test_se_set_secure_element_type_sync,
757                 "Set secure element type"
758         },
759
760         {
761                 "SE",
762                 "Open",
763                 net_nfc_test_se_open_internal_secure_element,
764                 net_nfc_test_se_open_internal_secure_element_sync,
765                 "Open internal secure element"
766         },
767
768         {
769                 "SE",
770                 "Close",
771                 net_nfc_test_se_close_internal_secure_element,
772                 net_nfc_test_se_close_internal_secure_element_sync,
773                 "Close internal secure element"
774         },
775
776         {
777                 "SE",
778                 "GetAtr",
779                 net_nfc_test_se_get_atr,
780                 net_nfc_test_se_get_atr_sync,
781                 "Get secure element attribute"
782         },
783
784         {
785                 "SE",
786                 "SetEventCallback",
787                 net_nfc_test_se_set_event_cb,
788                 NULL,
789                 "Set event callback"
790         },
791
792         {
793                 "SE",
794                 "UnsetEventCallback",
795                 net_nfc_test_se_unset_event_cb,
796                 NULL,
797                 "Unset event callback"
798         },
799
800         {
801                 "SE",
802                 "SetDetectionCallback",
803                 net_nfc_test_se_set_ese_detection_cb,
804                 NULL,
805                 "Set detection callback"
806         },
807
808         {
809                 "SE",
810                 "UnsetDetectionCallback",
811                 net_nfc_test_se_unset_ese_detection_cb,
812                 NULL,
813                 "Unset detection callback"
814         },
815
816         {
817                 "SE",
818                 "SetTransactionCallback",
819                 net_nfc_test_se_set_transaction_event_cb,
820                 NULL,
821                 "Set transaction  callback"
822         },
823
824         {
825                 "SE",
826                 "UnsetTransactionCallback",
827                 net_nfc_test_se_unset_transaction_event_cb,
828                 NULL,
829                 "Unset transaction callback"
830         },
831
832         {
833                 "SystemHandler",
834                 "SetLaunchPopState",
835                 net_nfc_test_sys_handler_set_launch_popup_state,
836                 net_nfc_test_sys_handler_set_launch_popup_state_sync,
837                 "Set launch popup state"
838         },
839
840         {
841                 "SystemHandler",
842                 "SetLaunchPopStateForce",
843                 net_nfc_test_sys_handler_set_launch_popup_state_force,
844                 net_nfc_test_sys_handler_set_launch_popup_state_force_sync,
845                 "Set launch popup state"
846         },
847
848         {
849                 "SystemHandler",
850                 "GetLaunchPopState",
851                 net_nfc_test_sys_handler_get_launch_popup_state,
852                 NULL,
853                 "Get launch popup state"
854         },
855
856         { NULL }
857 };
858
859
860 static GMainLoop *loop = NULL;
861
862 static GList *pos = NULL;
863
864 static void test_string_free(gpointer data);
865
866 static void run_test(void);
867
868 static void test_string_free(gpointer data)
869 {
870         gchar **strv;
871
872         if (data)
873         {
874                 strv = data;
875                 g_strfreev(strv);
876         }
877 }
878
879 static void run_test(void)
880 {
881         gchar **strv;
882         gint  i = 0;
883
884         if (pos == NULL)
885                 return;
886
887         strv = pos->data;
888
889         for (i = 0; test_data[i].interface != NULL; i++)
890         {
891                 if (strv[0] == NULL)
892                         continue;
893
894                 if (strv[1] == NULL)
895                         continue;
896
897                 if ((strcmp(strv[0], test_data[i].interface) == 0) &&
898                                 (strcmp(strv[1], test_data[i].name) == 0))
899                 {
900                         pos = pos->next;
901
902
903                         if (strv[2] && strcmp(strv[2], "Sync") == 0)
904                         {
905                                 g_print("run %s.%s(Sync)\n", strv[0], strv[1]);
906                                 test_data[i].func_sync(NULL,
907                                                 (gpointer)run_test);
908                         }
909                         else
910                         {
911                                 g_print("run %s.%s\n", strv[0], strv[1]);
912                                 test_data[i].func(NULL,
913                                                 (gpointer)run_test);
914                         }
915
916                         break;
917                 }
918         }
919 }
920
921 int main(int argc, char *argv[])
922 {
923         gint i;
924
925         if (argc == 2 && strcmp(argv[1], "--help") == 0)
926         {
927                 g_print("nfc-client-test: nfc-client-test [inteface.name]\n");
928                 g_print("\n");
929
930                 for (i = 0; i < G_N_ELEMENTS(test_data) - 1; i++)
931                 {
932                         g_print("\t%s - %s : %s\n", test_data[i].interface,
933                                         test_data[i].name,
934                                         test_data[i].comment);
935                 }
936                 return 0;
937         }
938
939         for (i = 1 ; i < argc ; i++)
940         {
941                 gchar **strv;
942
943                 strv = g_strsplit(argv[i], ".", 3);
944                 pos = g_list_append(pos, strv);
945         }
946
947         if (pos == NULL)
948         {
949                 gchar **strv;
950
951                 strv = g_strsplit("Manager.SetActive", ".", 3);
952                 pos = g_list_append(pos, strv);
953         }
954         else
955         {
956                 gchar **strv;
957
958                 strv = pos->data;
959
960                 if (strcmp(strv[0], "Manager") != 0 ||
961                                 strcmp(strv[1], "SetActive") != 0)
962                 {
963                         gchar **manager_strv;
964
965                         manager_strv = g_strsplit("Manager.SetActive", ".", 3);
966                         pos = g_list_prepend(pos, manager_strv);
967                 }
968         }
969
970         net_nfc_client_initialize();
971
972         run_test();
973
974         loop = g_main_loop_new(NULL, FALSE);
975
976         g_main_loop_run(loop);
977
978         net_nfc_client_deinitialize();
979
980         if (pos)
981                 g_list_free_full(pos, test_string_free);
982
983         return 0;
984 }