[Pcsclite-cvs-commit] r2198 - trunk/PCSC/src
Ludovic Rousseau
rousseau at alioth.debian.org
Wed Nov 15 11:07:25 CET 2006
Author: rousseau
Date: 2006-11-15 11:07:25 +0100 (Wed, 15 Nov 2006)
New Revision: 2198
Modified:
trunk/PCSC/src/testpcsc.c
Log:
test for SCARD_ATTR_MAXINPUT (only supported by my CCID driver for now)
Modified: trunk/PCSC/src/testpcsc.c
===================================================================
--- trunk/PCSC/src/testpcsc.c 2006-11-15 10:04:18 UTC (rev 2197)
+++ trunk/PCSC/src/testpcsc.c 2006-11-15 10:07:25 UTC (rev 2198)
@@ -25,6 +25,7 @@
#define PANIC 0
#define DONT_PANIC 1
+#define RED_PRINTF_FORMAT "\33[01;31m%s\33[0m\n"
void test_rv(int rv, SCARDCONTEXT hContext, int dont_panic)
{
@@ -34,7 +35,7 @@
printf("\33[34m%s (don't panic)\33[0m\n", pcsc_stringify_error(rv));
else
{
- printf("\33[01;31m%s\33[0m\n", pcsc_stringify_error(rv));
+ printf(RED_PRINTF_FORMAT, pcsc_stringify_error(rv));
SCardReleaseContext(hContext);
exit(-1);
}
@@ -231,6 +232,18 @@
printf("Testing SCardGetAttrib : ");
dwAtrLen = sizeof(pbAtr);
+ rv = SCardGetAttrib(hCard, SCARD_ATTR_MAXINPUT, pbAtr, &dwAtrLen);
+ test_rv(rv, hContext, DONT_PANIC);
+ if (rv == SCARD_S_SUCCESS)
+ {
+ if (dwAtrLen == sizeof(uint32_t))
+ printf("Max message length : %d\n", *(uint32_t *)pbAtr);
+ else
+ printf(RED_PRINTF_FORMAT, "Wrong size");
+ }
+
+ printf("Testing SCardGetAttrib : ");
+ dwAtrLen = sizeof(pbAtr);
rv = SCardGetAttrib(hCard, SCARD_ATTR_VENDOR_NAME, pbAtr, &dwAtrLen);
test_rv(rv, hContext, DONT_PANIC);
if (rv == SCARD_S_SUCCESS)
More information about the Pcsclite-cvs-commit
mailing list