uw29245.pp 600 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. unit uw29245;
  2. {$mode delphi}
  3. interface
  4. type
  5. TFoo = class
  6. class var
  7. F: array of TObject;
  8. private
  9. class constructor Create;
  10. class destructor Destroy;
  11. end;
  12. implementation
  13. class constructor TFoo.Create;
  14. begin
  15. writeln('tfoo class constructor');
  16. SetLength(F, 10);
  17. end;
  18. class destructor TFoo.Destroy;
  19. begin
  20. writeln('tfoo class destructor');
  21. if length(TFOO.F)<>10 then
  22. halt(3);
  23. end;
  24. initialization
  25. writeln('unit initialization');
  26. if length(TFOO.F)<>10 then
  27. halt(1);
  28. finalization
  29. writeln('unit finalization');
  30. if length(TFOO.F)<>10 then
  31. halt(2);
  32. end.