+ jvm setstring test

git-svn-id: trunk@28827 -
This commit is contained in:
Jonas Maebe 2014-10-15 20:50:14 +00:00
parent 5a8c007b73
commit 3355d0eea0
4 changed files with 39 additions and 0 deletions

1
.gitattributes vendored
View File

@ -11016,6 +11016,7 @@ tests/test/jvm/tset1.pp svneol=native#text/plain
tests/test/jvm/tset3.pp svneol=native#text/plain
tests/test/jvm/tset7.pp svneol=native#text/plain
tests/test/jvm/tsetansistr.pp svneol=native#text/plain
tests/test/jvm/tsetstring.pp svneol=native#text/plain
tests/test/jvm/tsmallintarr.pp svneol=native#text/plain
tests/test/jvm/tstr.pp svneol=native#text/plain
tests/test/jvm/tstring1.pp svneol=native#text/plain

View File

@ -310,3 +310,7 @@ ppcjvm -O2 -g -B -Sa tprop6a -CTautosetterprefix=Set -CTautogetterprefix=Get
if %errorlevel% neq 0 exit /b %errorlevel%
java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. tprop6a
if %errorlevel% neq 0 exit /b %errorlevel%
ppcjvm -O2 -g -B -CTinitlocals tsetstring
if %errorlevel% neq 0 exit /b %errorlevel%
java -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. tsetstring
if %errorlevel% neq 0 exit /b %errorlevel%

View File

@ -182,3 +182,5 @@ $PPC -O2 -g -B -Sa tprop6a
java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tprop6a
$PPC -O2 -g -B -Sa tprop6a -CTautosetterprefix=Set -CTautogetterprefix=Get
java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tprop6a
$PPC -O2 -g -B -Sa tsetstring
java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tsetstring

View File

@ -0,0 +1,32 @@
program tsetstring;
type
tstr866 = type ansistring(866);
var
str866: tstr866;
a: ansistring;
u: unicodestring;
s: shortstring;
pa: pansichar;
begin
setstring(str866,'abcdef',5);
if stringcodepage(str866)<>866 then
halt(1);
if str866<>'abcde' then
halt(2);
setstring(a,'abc',3);
if (stringcodepage(a)<>0) and
(stringcodepage(a)<>DefaultSystemCodePage) then
halt(3);
if a<>'abc' then
halt(4);
pa:='12345';
setstring(u,pa,5);
if u<>'12345' then
halt(5);
setstring(s,pa,5);
if s<>'12345' then
halt(7);
end.