RegressionTests__Win32OLETests.st
changeset 1722 54ee95429abb
parent 1707 76213a555906
child 2233 73a9c0ab4b0a
--- a/RegressionTests__Win32OLETests.st	Tue Oct 10 13:47:10 2017 +0200
+++ b/RegressionTests__Win32OLETests.st	Tue Oct 10 14:28:08 2017 +0200
@@ -66,40 +66,42 @@
 !
 
 test02_GuidFromProgID
-    |guid|
+    |guid appToId|
 
-    self skipIf:[OperatingSystem isMSWINDOWSlike not] description:'test skipped (OS is not WINDOWS)'.
+    self 
+        skipIf:[OperatingSystem isMSWINDOWSlike not] 
+        description:'test skipped (OS is not WINDOWS)'.
 
     self
         should:[
-            guid := (GUID clsidFromProgID:'Foo.Bar').
-        ] raise:OLEError.
+            guid := GUID clsidFromProgID:'Foo.Bar'.
+        ] 
+        raise:OLEError.
 
-    OLEError handle:[:ex |
-        ex hresult = (OLEStatusCodeConstants at:#CO_E_CLASSSTRING) ifTrue:[
-            "/ kind of expected - you machine has no AcroPDF installed...
-            Transcript showCR:'OLE: class not found: AcroPDF.PDF'
-        ] ifFalse:[
-            self assert:false description:'unexpected error code'.
-        ]
-    ] do:[
-        guid := (GUID clsidFromProgID:'AcroPDF.PDF').
-        self assert:(guid notNil).
-        "/ self assert:(guid printString = '').
+    appToId := Dictionary new.
+    appToId at:'AcroPDF.PDF'                        put:nil.
+    appToId at:'InternetExplorer.Application'       put:'{0002DF01-0000-0000-C000-000000000046}'.
+    appToId at:'Msxml2.DOMDocument.4.0'             put:'{88D969C0-F192-11D4-A65F-0040963251E5}'.
+    appToId at:'Microsoft.JScript.Vsa.VsaEngine'    put:'{B71E484D-93ED-4B56-BFB9-CEED5134822B}'.
+        
+    appToId keysAndValuesDo:[:app :id |
+        OLEError handle:[:ex |
+            ex hresult = (OLEStatusCodeConstants at:#CO_E_CLASSSTRING) ifTrue:[
+                "/ kind of expected - your machine has app not installed...
+                Transcript showCR:'OLE: class not found: ', app
+            ] ifFalse:[
+                self assert:false description:'unexpected error code'.
+            ]
+        ] do:[
+            guid := GUID clsidFromProgID:app.
+            self assert:guid notNil.
+
+            id notNil ifTrue:[
+                self assert:guid printString = id.
+            ].
+        ].
     ].
 
-     guid := (GUID clsidFromProgID:'InternetExplorer.Application').
-     self assert:(guid notNil).
-     self assert:(guid printString = '{0002DF01-0000-0000-C000-000000000046}').
-
-     guid := (GUID clsidFromProgID: 'Msxml2.DOMDocument.4.0').
-     self assert:(guid notNil).
-     self assert:(guid printString = '{88D969C0-F192-11D4-A65F-0040963251E5}').
-
-     guid := (GUID clsidFromProgID: 'Microsoft.JScript.Vsa.VsaEngine').
-     self assert:(guid notNil).
-     self assert:(guid printString = '{B71E484D-93ED-4B56-BFB9-CEED5134822B}').
-
     "
      self new test02_GuidFromProgID
     "
@@ -111,6 +113,7 @@
     |clsID enumerator nextVerb|
 
     self skipIf:[OperatingSystem isMSWINDOWSlike not] description:'test skipped (OS is not WINDOWS)'.
+    self skipIf:true description:'tests unfinished code'.
 
     clsID := GUID clsidFromProgID:'InternetExplorer.Application'.
     self assert:clsID notNil.
@@ -135,6 +138,7 @@
      ids visibleID params result specTable|
 
     self skipIf:[OperatingSystem isMSWINDOWSlike not] description:'test skipped (OS is not WINDOWS)'.
+    self skipIf:true description:'tests unfinished code'.
 
     guid := (GUID clsidFromProgID:'InternetExplorer.Application').
     self assert:(guid notNil).
@@ -176,10 +180,8 @@
 
     params := OLE_DISPPARAMS new.
     params cArgs: 1.
-    params arguments:(Array with:true).
-self halt.
+    params arguments:(Array with:true asOLEVariant).
     result := iWebBrowser2 invokePropertyPut: visibleID with:params.
-self halt.
     self assert:(result == false).
 
     iWebBrowser2 release.