mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 11:10:37 +02:00
some bug #896 related tests
This commit is contained in:
parent
9c44048ad2
commit
7a5fcf6931
16
tests/webtbf/tbug896.pp
Normal file
16
tests/webtbf/tbug896.pp
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
var
|
||||
dat : file;
|
||||
j : longint;
|
||||
Buffer : Array[0..2047] of byte;
|
||||
|
||||
begin
|
||||
for j:=0 to 2047 do
|
||||
Buffer[j]:=j and $ff;
|
||||
Assign(dat,'tbug896.txt');
|
||||
Rewrite(dat,1);
|
||||
for j:= 0 to 2047 do
|
||||
{ write should not be allowed for untyped files }
|
||||
write (dat,Buffer[j]);
|
||||
Close(dat);
|
||||
end.
|
16
tests/webtbf/tbug896a.pp
Normal file
16
tests/webtbf/tbug896a.pp
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
var
|
||||
dat : file of byte;
|
||||
j : longint;
|
||||
Buffer : Array[0..2047] of byte;
|
||||
|
||||
begin
|
||||
for j:=0 to 2047 do
|
||||
Buffer[j]:=j and $ff;
|
||||
Assign(dat,'tbug896.txt');
|
||||
Rewrite(dat,1);
|
||||
for j:= 0 to 2047 do
|
||||
{ writeln should not be allowed for typed files }
|
||||
writeln (dat,Buffer[j]);
|
||||
Close(dat);
|
||||
end.
|
34
tests/webtbs/tbug896.pp
Normal file
34
tests/webtbs/tbug896.pp
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
var
|
||||
dat,dat2 : file of byte;
|
||||
j : longint;
|
||||
Buffer,Buffer2 : Array[0..2047] of byte;
|
||||
|
||||
begin
|
||||
for j:=0 to 2047 do
|
||||
Buffer[j]:=j and $ff;
|
||||
Assign(dat,'tbug896.txt');
|
||||
Rewrite(dat,1);
|
||||
for j:= 0 to 2047 do
|
||||
write (dat,Buffer[j]);
|
||||
Close(dat);
|
||||
Assign(dat2,'tbug896a.txt');
|
||||
Rewrite(dat2);
|
||||
for j:= 0 to 2047 do
|
||||
write (dat2,Buffer[j]);
|
||||
Close(dat2);
|
||||
Reset(dat);
|
||||
Reset(dat2,1);
|
||||
for j:=0 to 2047 do
|
||||
begin
|
||||
read(dat,Buffer[j]);
|
||||
read(dat2,Buffer2[j]);
|
||||
if Buffer[j]<>Buffer2[j] then
|
||||
begin
|
||||
Writeln('Error in typed file handling');
|
||||
Halt(1);
|
||||
end;
|
||||
end;
|
||||
Close(dat);
|
||||
close(dat2);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user