[Pcsclite-cvs-commit] r3017 - /trunk/PCSC/src/testpcsc.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Tue Jun 24 08:17:35 UTC 2008
Author: rousseau
Date: Tue Jun 24 08:17:35 2008
New Revision: 3017
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3017
Log:
test SCardListReaderGroups() with USE_AUTOALLOCATE
Modified:
trunk/PCSC/src/testpcsc.c
Modified: trunk/PCSC/src/testpcsc.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/testpcsc.c?rev=3017&op=diff
==============================================================================
--- trunk/PCSC/src/testpcsc.c (original)
+++ trunk/PCSC/src/testpcsc.c Tue Jun 24 08:17:35 2008
@@ -98,12 +98,17 @@
test_rv(rv, hContext, PANIC);
printf("Testing SCardListReaderGroups\t: ");
+#ifdef USE_AUTOALLOCATE
+ dwGroups = SCARD_AUTOALLOCATE;
+ rv = SCardListReaderGroups(hContext, (LPSTR)&mszGroups, &dwGroups);
+#else
rv = SCardListReaderGroups(hContext, NULL, &dwGroups);
test_rv(rv, hContext, PANIC);
printf("Testing SCardListReaderGroups\t: ");
mszGroups = calloc(dwGroups, sizeof(char));
rv = SCardListReaderGroups(hContext, mszGroups, &dwGroups);
+#endif
test_rv(rv, hContext, PANIC);
/*
@@ -114,11 +119,16 @@
{
++p;
printf(GREEN "Group %02d: %s\n" NORMAL, p, &mszGroups[i]);
- iList[p] = i;
while (mszGroups[++i] != 0) ;
}
+#ifdef USE_AUTOALLOCATE
+ printf("Testing SCardFreeMemory\t\t: ");
+ rv = SCardFreeMemory(hContext, mszGroups);
+ test_rv(rv, hContext, PANIC);
+#else
free(mszGroups);
+#endif
wait_for_card_again:
printf("Testing SCardListReaders\t: ");
@@ -127,7 +137,6 @@
#ifdef USE_AUTOALLOCATE
dwReaders = SCARD_AUTOALLOCATE;
rv = SCardListReaders(hContext, mszGroups, (LPSTR)&mszReaders, &dwReaders);
- test_rv(rv, hContext, PANIC);
#else
rv = SCardListReaders(hContext, mszGroups, NULL, &dwReaders);
test_rv(rv, hContext, PANIC);
@@ -135,8 +144,8 @@
printf("Testing SCardListReaders\t: ");
mszReaders = calloc(dwReaders, sizeof(char));
rv = SCardListReaders(hContext, mszGroups, mszReaders, &dwReaders);
- test_rv(rv, hContext, PANIC);
-#endif
+#endif
+ test_rv(rv, hContext, PANIC);
/*
* Have to understand the multi-string here
More information about the Pcsclite-cvs-commit
mailing list