[Pcsclite-cvs-commit] r2700 - /trunk/HandlerTest/Host/handler_test.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Sat Nov 17 14:21:08 UTC 2007


Author: rousseau
Date: Sat Nov 17 14:21:08 2007
New Revision: 2700

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=2700
Log:
test only TPDU or APDU as requested for case 1

Modified:
    trunk/HandlerTest/Host/handler_test.c

Modified: trunk/HandlerTest/Host/handler_test.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/HandlerTest/Host/handler_test.c?rev=2700&op=diff
==============================================================================
--- trunk/HandlerTest/Host/handler_test.c (original)
+++ trunk/HandlerTest/Host/handler_test.c Sat Nov 17 14:21:08 2007
@@ -574,42 +574,48 @@
 
 	if (cases & CASE1)
 	{
-		/* Case 1, APDU */
-		text = "Case 1, APDU: CLA INS P1 P2, L(Cmd) = 4";
-		s[0] = 0x80;
-		s[1] = 0x30;
-		s[2] = 0x00;
-		s[3] = 0x00;
-
-		dwSendLength = 4;
-		dwRecvLength = sizeof(r);
-
-		e[0] = 0x90;
-		e[1] = 0x00;
-		e_length = 2;
-
-		if (exchange(text, lun, SendPci, &RecvPci,
-			s, dwSendLength, r, &dwRecvLength, e, e_length))
-			return 1;
-
-		/* Case 1, TPDU */
-		text = "Case 1, TPDU: CLA INS P1 P2 P3 (=0), L(Cmd) = 5";
-		s[0] = 0x80;
-		s[1] = 0x30;
-		s[2] = 0x00;
-		s[3] = 0x00;
-		s[4] = 0x00;
-
-		dwSendLength = 5;
-		dwRecvLength = sizeof(r);
-
-		e[0] = 0x90;
-		e[1] = 0x00;
-		e_length = 2;
-
-		if (exchange(text, lun, SendPci, &RecvPci,
-			s, dwSendLength, r, &dwRecvLength, e, e_length))
-			return 1;
+		if (apdu)
+		{
+			/* Case 1, APDU */
+			text = "Case 1, APDU: CLA INS P1 P2, L(Cmd) = 4";
+			s[0] = 0x80;
+			s[1] = 0x30;
+			s[2] = 0x00;
+			s[3] = 0x00;
+
+			dwSendLength = 4;
+			dwRecvLength = sizeof(r);
+
+			e[0] = 0x90;
+			e[1] = 0x00;
+			e_length = 2;
+
+			if (exchange(text, lun, SendPci, &RecvPci,
+						s, dwSendLength, r, &dwRecvLength, e, e_length))
+				return 1;
+		}
+
+		if (tpdu)
+		{
+			/* Case 1, TPDU */
+			text = "Case 1, TPDU: CLA INS P1 P2 P3 (=0), L(Cmd) = 5";
+			s[0] = 0x80;
+			s[1] = 0x30;
+			s[2] = 0x00;
+			s[3] = 0x00;
+			s[4] = 0x00;
+
+			dwSendLength = 5;
+			dwRecvLength = sizeof(r);
+
+			e[0] = 0x90;
+			e[1] = 0x00;
+			e_length = 2;
+
+			if (exchange(text, lun, SendPci, &RecvPci,
+						s, dwSendLength, r, &dwRecvLength, e, e_length))
+				return 1;
+		}
 	}
 
 	if (cases & CASE2)




More information about the Pcsclite-cvs-commit mailing list