Browse Source

* small fixes

peter 24 years ago
parent
commit
a576e82342
3 changed files with 19 additions and 80 deletions
  1. 4 1
      tests/tbs/tb0364.pp
  2. 0 76
      tests/webtbf/tw1397.pp
  3. 15 3
      tests/webtbs/tw1409.pp

+ 4 - 1
tests/tbs/tb0364.pp

@@ -1,7 +1,7 @@
 uses
 uses
    sysutils;
    sysutils;
 
 
-{ comment by submitter: 
+{ comment by submitter:
   The following statement (which works in Delphi)
   The following statement (which works in Delphi)
     result:=Format('%10.n', [ival*1.0]);
     result:=Format('%10.n', [ival*1.0]);
   generated an unhandled exception (and said: Missing argument in format "").
   generated an unhandled exception (and said: Missing argument in format "").
@@ -23,8 +23,11 @@ var
    ival : integer;
    ival : integer;
 
 
 begin
 begin
+   ThousandSeparator:='.';
+   DecimalSeparator:=',';
    ival:=1234;
    ival:=1234;
    s:=Format('%10.n', [ival*1.0]);
    s:=Format('%10.n', [ival*1.0]);
+   writeln('s: "',s,'"');
    if s<>'     1.234' then
    if s<>'     1.234' then
      begin
      begin
         writeln('Problem with Format');
         writeln('Problem with Format');

+ 0 - 76
tests/webtbf/tw1397.pp

@@ -1,76 +0,0 @@
-{ %fail% }
-
-uses
-  Objects;
-
-var
-  Coll  : PCollection;
-  Thing : PObject;
-
-  Line1 : String;                            {*** This is a global variable ***}
-
-
-procedure Zero;
-
-  var
-    Line2 : String;                           {*** This is a local variable ***}
-
-  procedure Two (Thing: PObject);
-  begin
-    Line1 := 'BBB';
-    Line2 := 'BBB';
-
-    WriteLn('2: ', Line1, ' * ', Line2);                 {*** Output line 2 ***}
-    if Line2<>'BBB' then
-     begin
-       writeln('ERROR!');
-       halt(1);
-     end;
-  end;
-
-  procedure One (Thing: PObject);
-
-    procedure LocalTwo (Thing: PObject);
-    begin
-      Line1 := 'BBB';
-      Line2 := 'BBB';
-
-      WriteLn('2: ', Line1, ' * ', Line2);                 {*** Output line 2 ***}
-      if Line2<>'BBB' then
-       begin
-         writeln('ERROR!');
-         halt(1);
-       end;
-    end;
-
-  begin
-    Line1 := 'AAA';
-    Line2 := 'AAA';
-
-    WriteLn('1: ', Line1, ' * ', Line2);                 {*** Output line 1 ***}
-
-    Coll^.ForEach(@LocalTwo);
-
-    WriteLn('3: ', Line1, ' * ', Line2);                 {*** Output line 3 ***}
-    if Line2<>'BBB' then
-     begin
-       writeln('ERROR!');
-       halt(1);
-     end;
-  end;
-                                         {*** I expected that output line 3 ***}
-begin                                    {*** would be the same as output   ***}
-  Coll^.ForEach(@One);                   {*** line 2. It is not.            ***}
-end;
-
-
-begin
-  New(Coll, Init(1, 1));
-
-  New(Thing, Init);
-  Coll^.Insert(Thing);
-
-  Zero;
-
-  Dispose(Coll, Done);
-end.

+ 15 - 3
tests/webtbs/tw1409.pp

@@ -6,13 +6,25 @@ type
 
 
 procedure Test(const Args: array of TPoint);
 procedure Test(const Args: array of TPoint);
 begin
 begin
+{$ifndef VER1_0}
+  writeln(length(Args));
+  if length(Args)<>2 then
+   halt(1);
+{$endif VER1_0}
+  writeln(high(Args));
+  if high(Args)<>1 then
+   halt(1);
   writeln(Args[0].x,',',Args[0].y);
   writeln(Args[0].x,',',Args[0].y);
-  if (Args[0].x<>10) and (Args[0].y<>10) then
+  if (Args[0].x<>10) or (Args[0].y<>20) then
+   halt(1);
+  writeln(Args[1].x,',',Args[1].y);
+  if (Args[1].x<>30) or (Args[1].y<>40) then
    halt(1);
    halt(1);
 end;
 end;
 
 
 const
 const
-  p1: TPoint = (x: 10; y: 10);
+  p1: TPoint = (x: 10; y: 20);
+  p2: TPoint = (x: 30; y: 40);
 begin
 begin
-  Test([p1]);
+  Test([p1,p2]);
 end.
 end.