Browse Source

* added bugs

peter 24 years ago
parent
commit
474befaba9
5 changed files with 116 additions and 0 deletions
  1. 15 0
      tests/tbs/tb0339.pp
  2. 18 0
      tests/tbs/ub0339.pp
  3. 6 0
      tests/webtbs/tw1395.pp
  4. 60 0
      tests/webtbs/tw1397.pp
  5. 17 0
      tests/webtbs/tw1398.pp

+ 15 - 0
tests/tbs/tb0339.pp

@@ -0,0 +1,15 @@
+{$mode TP}
+uses ub0339;
+type
+  r = packed record
+        Foo : Boolean;
+        Bar : (No, Yes);
+        Baz : 0 .. 3;
+        Qux : -1 .. 0;
+        Fred : 1 .. 7
+      end;
+begin
+  Writeln ('AAA: Size of packed record r = ', SizeOf (r), ' bytes.');
+  Writeln ('AAA: Size of packed record r2 = ', SizeOf (r2), ' bytes.');
+  PrintSize;
+end.

+ 18 - 0
tests/tbs/ub0339.pp

@@ -0,0 +1,18 @@
+{$mode FPC}
+unit ub0339;
+interface
+type
+  r2 = packed record
+        Foo : Boolean;
+        Bar : (No, Yes);
+        Baz : 0 .. 3;
+        Qux : -1 .. 0;
+        Fred : 1 .. 7
+      end;
+  procedure PrintSize;
+implementation
+  procedure PrintSize;
+  begin
+    Writeln ('BBB: Size of packed record r2 = ', SizeOf (r2), ' bytes.')
+  end;
+begin end.

+ 6 - 0
tests/webtbs/tw1395.pp

@@ -0,0 +1,6 @@
+var
+ a, b : pointer;
+
+begin
+ a^:=b^;
+end.

+ 60 - 0
tests/webtbs/tw1397.pp

@@ -0,0 +1,60 @@
+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);
+  begin
+    Line1 := 'AAA';
+    Line2 := 'AAA';
+
+    WriteLn('1: ', Line1, ' * ', Line2);                 {*** Output line 1 ***}
+
+    Coll^.ForEach(@Two);
+
+    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.

+ 17 - 0
tests/webtbs/tw1398.pp

@@ -0,0 +1,17 @@
+{$ifdef win32}
+uses Windows;
+
+function Enum_FindTaskWindow (hWindow:HWND; lpar:LPARAM) : boolean; export; stdcall;
+begin
+  Enum_FindTaskWindow := FALSE;
+end;
+
+var dwThread:DWORD;
+begin
+  dwThread := GetCurrentThreadId;
+  EnumTaskWindows (dwThread, @Enum_FindTaskWindow, LPARAM(NULL));
+
+{$else}
+begin
+{$endif}
+end.