From 85bc486eb2686adf84809eb3735229cc49419c34 Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 10 Nov 1998 11:34:53 +0000 Subject: [PATCH] * problem of write(pchar) --- tests/README | 1 + tests/ts010022.pp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tests/ts010022.pp diff --git a/tests/README b/tests/README index f276c9e151..4396842774 100644 --- a/tests/README +++ b/tests/README @@ -31,6 +31,7 @@ ts010019.pp tests problems of name mangling ts010020.pp tests for const strings problems if const is a single char. ts010021.pp test for long mangled names (they are strings, ie no longer then 255 chars (but they have to be allways shorten the same way !!) +ts010022.pp tests a problem of writing pchar in files ts10100.pp tests for delphi object model - ts101xx.pp diff --git a/tests/ts010022.pp b/tests/ts010022.pp new file mode 100644 index 0000000000..158138ce12 --- /dev/null +++ b/tests/ts010022.pp @@ -0,0 +1,46 @@ +program ts010022; + +const + EXCEPTIONCOUNT = 18; + exception_names : array[0..EXCEPTIONCOUNT-1] of pchar = ( + 'Division by Zero', + 'Debug', + 'NMI', + 'Breakpoint', + 'Overflow', + 'Bounds Check', + 'Invalid Opcode', + 'Coprocessor not available', + 'Double Fault', + 'Coprocessor overrun', + 'Invalid TSS', + 'Segment Not Present', + 'Stack Fault', + 'General Protection Fault', + 'Page fault', + ' ', + 'Coprocessor Error', + 'Alignment Check'); + + single_pchar : pchar = 'Alone test'; + +const filename = 'ts010022.hlp'; + +var en : pchar; + f : text; + st : string; +begin + assign(f,filename); + rewrite(f); + en:=single_pchar; + Writeln(f,en); + en:=exception_names[6]; + writeln(f,en); + close(f); + reset(f); + readln(f,st); + if st<>'Alone test' then halt(1); + readln(f,st); + if st<>'Invalid opcode' then halt(1); + close(f); +end.