浏览代码

+ jvm setstring test

git-svn-id: trunk@28827 -
Jonas Maebe 10 年之前
父节点
当前提交
3355d0eea0
共有 4 个文件被更改,包括 39 次插入0 次删除
  1. 1 0
      .gitattributes
  2. 4 0
      tests/test/jvm/testall.bat
  3. 2 0
      tests/test/jvm/testall.sh
  4. 32 0
      tests/test/jvm/tsetstring.pp

+ 1 - 0
.gitattributes

@@ -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

+ 4 - 0
tests/test/jvm/testall.bat

@@ -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%

+ 2 - 0
tests/test/jvm/testall.sh

@@ -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 - 0
tests/test/jvm/tsetstring.pp

@@ -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.
+