mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 06:08:16 +02:00
+ jvm setstring test
git-svn-id: trunk@28827 -
This commit is contained in:
parent
5a8c007b73
commit
3355d0eea0
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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%
|
||||
|
@ -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
|
||||
|
32
tests/test/jvm/tsetstring.pp
Normal file
32
tests/test/jvm/tsetstring.pp
Normal 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.
|
||||
|
Loading…
Reference in New Issue
Block a user