* added new test for interface to tguid or shortstring constants

git-svn-id: trunk@12693 -
This commit is contained in:
ivost 2009-02-06 12:08:48 +00:00
parent 0f519439b5
commit 76694f6ec8
3 changed files with 44 additions and 0 deletions

1
.gitattributes vendored
View File

@ -7824,6 +7824,7 @@ tests/test/tinterface2.pp svneol=native#text/plain
tests/test/tinterface3.pp svneol=native#text/plain
tests/test/tinterface4.pp svneol=native#text/plain
tests/test/tinterface5.pp svneol=native#text/plain
tests/test/tinterface6.pp svneol=native#text/plain
tests/test/tinterrupt.pp svneol=native#text/plain
tests/test/tintfdef.pp svneol=native#text/plain
tests/test/tintuint.pp svneol=native#text/plain

36
tests/test/tinterface6.pp Normal file
View File

@ -0,0 +1,36 @@
{$mode objfpc}
uses
sysutils;
type
{$interfaces corba}
icorbainterface1 = interface
['STRING_UID']
end;
icorbainterface2 = interface
['{95B5633F-38A8-4D5F-A7FA-A2EA2664C670}']
end;
{$interfaces com}
icominterface = interface
['{04B6AB72-8F86-45F8-8D49-393E799F51A8}']
end;
const
iid_corba1: shortstring = icorbainterface1;
iid_corba2: shortstring = icorbainterface2;
iid_com: tguid = icominterface;
iid_comref: tguid = '{04B6AB72-8F86-45F8-8D49-393E799F51A8}';
begin
if iid_corba1 <> 'STRING_UID' then
halt(1);
if iid_corba2 <> '{95B5633F-38A8-4D5F-A7FA-A2EA2664C670}' then
halt(1);
if not IsEqualGUID(iid_com, iid_comref) then
halt(1);
end.

View File

@ -62,6 +62,13 @@ begin
writeln('getinterface icorbainterface1 not found');
end;
if testclass1.getinterface(icorbainterface2,po1) then begin
writeln('getinterface icorbainterface2 found');
end
else begin
writeln('getinterface icorbainterface2 not found');
end;
if testclass2.getinterface(icominterface,po1) then begin
writeln('getinterface icominterface found');
end