| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | # test.pl: simple sample program based on test.pl to test the pcsc |
| 4 | # Perl wrapper under Test::Harness |
| 5 | # Copyright (C) 2001 Lionel Victor, 2003,2006 Ludovic Rousseau |
| 6 | # |
| 7 | # This program is free software; you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; either version 2 of the License, or |
| 10 | # (at your option) any later version. |
| 11 | # |
| 12 | # This program is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with this program; if not, write to the Free Software |
| 19 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | |
| 21 | use Test::More; |
| 22 | use Chipcard::PCSC; |
| 23 | |
| 24 | plan tests => 2; |
| 25 | |
| 26 | use strict; |
| 27 | use warnings; |
| 28 | |
| 29 | my $hContext; |
| 30 | my @ReadersList; |
| 31 | |
| 32 | my @StatusResult; |
| 33 | my $tmpVal; |
| 34 | my $SendData; |
| 35 | my $RecvData; |
| 36 | |
| 37 | #------------------------------------------------------------------------------- |
| 38 | $hContext = new Chipcard::PCSC(); |
| 39 | #die ("not ok : Can't create the pcsc object: $Chipcard::PCSC::errno\n") unless (defined $hContext); |
| 40 | ok(defined $hContext, "new Chipcard::PCSC()"); |
| 41 | |
| 42 | #------------------------------------------------------------------------------- |
| 43 | @ReadersList = $hContext->ListReaders (); |
| 44 | #die ("not ok : Can't get readers' list: $Chipcard::PCSC::errno\n") unless (defined($ReadersList[0])); |
| 45 | ok(defined($ReadersList[0]), "\$hContext->ListReaders ()"); |
| 46 | |
| 47 | #------------------------------------------------------------------------------- |
| 48 | $hContext = undef; |
| 49 | |
| 50 | # End of File # |
| 51 |