mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 06:08:22 +02:00

of the jdk15 unit in that case) * adjusted testall.sh script so it can also be used to test class files compiled for Android (still with the JVM though) git-svn-id: branches/jvmbackend@19835 -
32 lines
572 B
ObjectPascal
32 lines
572 B
ObjectPascal
program sort;
|
|
|
|
{$mode delphi}
|
|
{$modeswitch unicodestrings}
|
|
|
|
uses
|
|
{$ifdef java}jdk15{$else}androidr14{$endif};
|
|
|
|
function test : string;
|
|
var
|
|
sa : array of JLObject;
|
|
L : JUList;
|
|
i : integer;
|
|
begin
|
|
SetLength(sa, 3);
|
|
sa[0] := JLString(string('2'));
|
|
sa[1] := JLString(string('3'));
|
|
sa[2] := JLString(string('1'));
|
|
L := JUArrays.asList(sa);
|
|
JUCollections.sort(L);
|
|
|
|
Result := '';
|
|
for i := 0 to L.size() - 1 do
|
|
Result := Result + string(L.get(i)) + string(' ');
|
|
end;
|
|
|
|
begin
|
|
jlsystem.fout.println(test);
|
|
if test<>'1 2 3 ' then
|
|
raise JLException.create;
|
|
end.
|