diff --git a/tests/audit.c b/tests/audit.c new file mode 100644 index 000000000..0e6f5284c --- /dev/null +++ b/tests/audit.c @@ -0,0 +1,53 @@ +/* + + This is a tiny test program that can be used to track down + strange effects of the emulation. + + Make: + + - gcc -o audit audit.c + + Usage: + + - In TEWidget.C let syslog be stdout. + - konsole > ttt + - produce the effect in question. + - run this program. + pressing any key advances the audit + ^C terminates. + + You need to make sure that the size of the screen matches + the one being debugged. + +*/ + + +#include +#include +#include + +struct termios save; +struct termios curr; + +#define HERE fprintf(stderr,"%s(%d): here.\n",__FILE__,__LINE__) + +main() +{ int cc; + FILE* sysin = fopen("ttt","r"); + tcgetattr(0, &save); + tcgetattr(0, &curr); + cfmakeraw(&curr); + tcsetattr(0, TCSANOW, &curr); + cc = fgetc(sysin); + while( cc > 0 ) + { int tmp; + while (cc > 0) + { + fputc(cc,stdout); cc = fgetc(sysin); + if (cc == 0x1b) break; + } + tmp = fgetc(stdin); + if (tmp == 3) break; + } + tcsetattr(0, TCSANOW, &save); +}