CT-API Test
===========

Build
-----

For unix, just compile it with

cc -o cttest cttest.c -ldl

For windows, either you get it to compile yourself, or use the
Makefile for VC5++ which comes with SCEZ.

If you do not want that much information, remove the VERBOSE define
near the top of cttest.c.

Usage
-----

cttest <library> <ptn>

library: This string is passed to dlopen/.

ptn: Port number passed to CT_init.

e.g.:
	cttest libctapi.so 1
	cttest ./libctapi.so 1
	cttest ctapiw32.dll 2

The program tells you while it runs, what to do with the reader.

Compiled with verbose it will output all longer responses and returned
data which it didn't like.

Tests
-----

This program tests so far the basic command set (CT-BCS) as is
required for readers without PIN pad and display. What each test does
is in the comments above each test function. Functions marked with
INTERPRETATION and the errors generated by the tests need IMO some
discussion. I've included the tests for the official Towitoko driver
and a version of the free Linux driver.

TODO
----

 - Memory cards.

Changes
-------

2000/02/13

 - First version.

2000/02/15

 - Extended and cleand up.

2000/02/18:

- Mats Hansson: If the buffer size denoted by lenr is to small CT_data
  should return a ERR_MEMORY. Tests changed: 5, 7, 10, 12, 14, 16, 13b,
  15b.
- Driver tests:
  Official MS-Windows Towitoko driver: 19/41
  Inofficial unix Towitoko driver: 20(18)/41
  Inofficial unix Schlumberger Reflex60 driver: 5/41

2000/02/22:

- Mats Hansson: eject( ctn ) is not executed, when the test fails, so
  it is moved to the begining of the following test. Tests changed: 3-7.
- dad=0 in test 22b.
- Check for SW1 was wrong in 3c.
- checksw->checkswext in 3c.

2000/02/27:

- Added struct CTAPI_INFO.
- Checking for CT-BCS version. Tests changed: 13, 15.

2000/02/28:

- Added tests 23-26 for DO type 0x80 with P1!=0 and type 0x81.
- React according to CT-BCS version. Tests changed: 13, 15, 12b, 14b.


