+ simple CompareByte0 test

git-svn-id: trunk@9218 -
This commit is contained in:
florian 2007-11-12 19:57:47 +00:00
parent da21fb10e3
commit 0801c64813
2 changed files with 24 additions and 0 deletions

1
.gitattributes vendored
View File

@ -7040,6 +7040,7 @@ tests/test/tclass7.pp svneol=native#text/plain
tests/test/tclass8.pp svneol=native#text/plain
tests/test/tclrprop.pp svneol=native#text/plain
tests/test/tcmp.pp svneol=native#text/plain
tests/test/tcmp0.pp svneol=native#text/plain
tests/test/tdispvar1.pp svneol=native#text/plain
tests/test/tendian1.pp svneol=native#text/plain
tests/test/tenum1.pp svneol=native#text/plain

23
tests/test/tcmp0.pp Normal file
View File

@ -0,0 +1,23 @@
program comparechar0bug;
var str1 : pchar = 'test';
str2 : pchar = 'test';
str3 : pchar = 'testa';
str4 : pchar = 'asdf';
res : longint;
begin
res:=CompareChar0(str1[0],str2[0],maxint);
if res<>0 then
halt(1);
res:=CompareChar0(str1[0],str3[0],maxint);
if res<>-1 then
halt(1);
res:=CompareChar0(str4[0],str1[0],maxint);
if res<>-1 then
halt(1);
res:=CompareChar0(str1[0],str4[0],maxint);
if res<>1 then
halt(1);
writeln('ok');
end.