* tests for checking type casts from integers/enums to TObjects in Delphi and non-Delphi mode (see r11398)

git-svn-id: trunk@11400 -
This commit is contained in:
tom_at_work 2008-07-18 15:53:37 +00:00
parent cc911887a8
commit f11cf59854
4 changed files with 44 additions and 0 deletions

3
.gitattributes vendored
View File

@ -6451,6 +6451,8 @@ tests/tbf/tb0206.pp svneol=native#text/plain
tests/tbf/tb0207.pp svneol=native#text/plain
tests/tbf/tb0208.pp svneol=native#text/plain
tests/tbf/tb0209.pp svneol=native#text/plain
tests/tbf/tb0210.pp svneol=native#text/plain
tests/tbf/tb0211.pp svneol=native#text/plain
tests/tbf/ub0115.pp svneol=native#text/plain
tests/tbf/ub0149.pp svneol=native#text/plain
tests/tbf/ub0158a.pp svneol=native#text/plain
@ -7001,6 +7003,7 @@ tests/tbs/tb0550b.pp svneol=native#text/plain
tests/tbs/tb0551.pp svneol=native#text/plain
tests/tbs/tb0552.pp svneol=native#text/plain
tests/tbs/tb0553.pp svneol=native#text/plain
tests/tbs/tb0554.pp svneol=native#text/plain
tests/tbs/tb205.pp svneol=native#text/plain
tests/tbs/ub0060.pp svneol=native#text/plain
tests/tbs/ub0069.pp svneol=native#text/plain

14
tests/tbf/tb0210.pp Normal file
View File

@ -0,0 +1,14 @@
// check whether enums can NOT be casted to object references; this
// should NOT work in objfpc mode (see also tbs/tb0554.pp)
{$mode objfpc}
type
TEnum = (a, b, c);
var
e : TEnum;
o : TObject;
begin
o := TObject(e);
end.

11
tests/tbf/tb0211.pp Normal file
View File

@ -0,0 +1,11 @@
// check whether integers can NOT be casted to object references; this
// should NOT work in objfpc mode (see also tbs/tb0554.pp)
{$mode objfpc}
var
i : Integer;
o : TObject;
begin
o := TObject(i);
end.

16
tests/tbs/tb0554.pp Normal file
View File

@ -0,0 +1,16 @@
// check whether enums and integers can be casted to object references; this
// should work in Delphi mode (is Delphi compatible)
{$mode delphi}
type
TEnum = (a, b, c);
var
i : Integer;
e : TEnum;
o : TObject;
begin
o := TObject(e);
o := TObject(i);
end.