mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 12:29:25 +02:00
* 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:
parent
cc911887a8
commit
f11cf59854
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -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
14
tests/tbf/tb0210.pp
Normal 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
11
tests/tbf/tb0211.pp
Normal 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
16
tests/tbs/tb0554.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user