mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 02:50:42 +02:00
* problem of write(pchar)
This commit is contained in:
parent
636ad3ddee
commit
85bc486eb2
@ -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
|
||||
|
46
tests/ts010022.pp
Normal file
46
tests/ts010022.pp
Normal file
@ -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.
|
Loading…
Reference in New Issue
Block a user