Browse Source

tests: add 2 fail dispinterface test

git-svn-id: trunk@14749 -
paul 15 years ago
parent
commit
6bc01f8c7e
3 changed files with 54 additions and 0 deletions
  1. 2 0
      .gitattributes
  2. 26 0
      tests/test/tdispinterface1a.pp
  3. 26 0
      tests/test/tdispinterface1b.pp

+ 2 - 0
.gitattributes

@@ -8914,6 +8914,8 @@ tests/test/tclrprop.pp svneol=native#text/plain
 tests/test/tcmp.pp svneol=native#text/plain
 tests/test/tcmp0.pp svneol=native#text/plain
 tests/test/tdel1.pp svneol=native#text/plain
+tests/test/tdispinterface1a.pp svneol=native#text/pascal
+tests/test/tdispinterface1b.pp svneol=native#text/pascal
 tests/test/tendian1.pp svneol=native#text/plain
 tests/test/tenum1.pp svneol=native#text/plain
 tests/test/tenum2.pp svneol=native#text/plain

+ 26 - 0
tests/test/tdispinterface1a.pp

@@ -0,0 +1,26 @@
+{ %TARGET=win32}
+{ %FAIL}
+{ %NORUN }
+
+program tdispinterface1a;
+
+{$ifdef fpc}
+  {$mode objfpc}
+{$endif}
+
+uses
+  SysUtils, ActiveX, ComObj;
+
+type
+  IIE = dispinterface
+    ['{0002DF05-0000-0000-C000-000000000046}']
+    property Visible: wordbool readonly dispid 402;
+  end;
+
+var
+  II: IIE;
+begin
+  II := CreateOleObject('InternetExplorer.Application') as IIE;
+  if not II.Visible then
+    II.Visible := True;  // must fail because property is readonly
+end.

+ 26 - 0
tests/test/tdispinterface1b.pp

@@ -0,0 +1,26 @@
+{ %TARGET=win32}
+{ %FAIL}
+{ %NORUN }
+
+program tdispinterface1b;
+
+{$ifdef fpc}
+  {$mode objfpc}
+{$endif}
+
+uses
+  SysUtils, ActiveX, ComObj;
+
+type
+  IIE = dispinterface
+    ['{0002DF05-0000-0000-C000-000000000046}']
+    property Visible: wordbool writeonly dispid 402;
+  end;
+
+var
+  II: IIE;
+begin
+  II := CreateOleObject('InternetExplorer.Application') as IIE;
+  if not II.Visible then // must fail because property is writeonly
+    II.Visible := True;
+end.