From a576e82342c5004bd2500cabd17e226afb570d6e Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 1 Aug 2001 21:41:27 +0000 Subject: [PATCH] * small fixes --- tests/tbs/tb0364.pp | 5 ++- tests/webtbf/tw1397.pp | 76 ------------------------------------------ tests/webtbs/tw1409.pp | 18 ++++++++-- 3 files changed, 19 insertions(+), 80 deletions(-) delete mode 100644 tests/webtbf/tw1397.pp diff --git a/tests/tbs/tb0364.pp b/tests/tbs/tb0364.pp index 53af72b3e8..bb87109fcd 100644 --- a/tests/tbs/tb0364.pp +++ b/tests/tbs/tb0364.pp @@ -1,7 +1,7 @@ uses sysutils; -{ comment by submitter: +{ comment by submitter: The following statement (which works in Delphi) result:=Format('%10.n', [ival*1.0]); generated an unhandled exception (and said: Missing argument in format ""). @@ -23,8 +23,11 @@ var ival : integer; begin + ThousandSeparator:='.'; + DecimalSeparator:=','; ival:=1234; s:=Format('%10.n', [ival*1.0]); + writeln('s: "',s,'"'); if s<>' 1.234' then begin writeln('Problem with Format'); diff --git a/tests/webtbf/tw1397.pp b/tests/webtbf/tw1397.pp deleted file mode 100644 index db0cb0a569..0000000000 --- a/tests/webtbf/tw1397.pp +++ /dev/null @@ -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. diff --git a/tests/webtbs/tw1409.pp b/tests/webtbs/tw1409.pp index 97dab18e01..8e23132a5a 100644 --- a/tests/webtbs/tw1409.pp +++ b/tests/webtbs/tw1409.pp @@ -6,13 +6,25 @@ type procedure Test(const Args: array of TPoint); 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); - 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); end; const - p1: TPoint = (x: 10; y: 10); + p1: TPoint = (x: 10; y: 20); + p2: TPoint = (x: 30; y: 40); begin - Test([p1]); + Test([p1,p2]); end.