From 0801c64813539cf02dafd1c21866024cdebe19c5 Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 12 Nov 2007 19:57:47 +0000 Subject: [PATCH] + simple CompareByte0 test git-svn-id: trunk@9218 - --- .gitattributes | 1 + tests/test/tcmp0.pp | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/test/tcmp0.pp diff --git a/.gitattributes b/.gitattributes index 70ec803fd9..1002f9964b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/tests/test/tcmp0.pp b/tests/test/tcmp0.pp new file mode 100644 index 0000000000..5f1759d764 --- /dev/null +++ b/tests/test/tcmp0.pp @@ -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.