mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-06 21:06:09 +02:00
+ simple CompareByte0 test
git-svn-id: trunk@9218 -
This commit is contained in:
parent
da21fb10e3
commit
0801c64813
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7040,6 +7040,7 @@ tests/test/tclass7.pp svneol=native#text/plain
|
|||||||
tests/test/tclass8.pp svneol=native#text/plain
|
tests/test/tclass8.pp svneol=native#text/plain
|
||||||
tests/test/tclrprop.pp svneol=native#text/plain
|
tests/test/tclrprop.pp svneol=native#text/plain
|
||||||
tests/test/tcmp.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/tdispvar1.pp svneol=native#text/plain
|
||||||
tests/test/tendian1.pp svneol=native#text/plain
|
tests/test/tendian1.pp svneol=native#text/plain
|
||||||
tests/test/tenum1.pp svneol=native#text/plain
|
tests/test/tenum1.pp svneol=native#text/plain
|
||||||
|
23
tests/test/tcmp0.pp
Normal file
23
tests/test/tcmp0.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user