1353
|
1 |
"{ Package: 'exept:regression' }"
|
|
2 |
|
|
3 |
"{ NameSpace: RegressionTests }"
|
|
4 |
|
|
5 |
TestCase subclass:#Win32OLETests
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'tests-Regression-RuntimeSystem'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
1355
|
13 |
!Win32OLETests class methodsFor:'queries'!
|
|
14 |
|
|
15 |
coveredPackageNames
|
|
16 |
^ #('exept:ole')
|
|
17 |
! !
|
|
18 |
|
1353
|
19 |
!Win32OLETests methodsFor:'tests'!
|
|
20 |
|
|
21 |
test00_loadOLE
|
|
22 |
|iid_IEnum|
|
|
23 |
|
|
24 |
OperatingSystem isMSWINDOWSlike ifFalse:[
|
|
25 |
Transcript showCR:'test skipped (OS is not WINDOWS)'.
|
|
26 |
^ self.
|
|
27 |
].
|
|
28 |
|
|
29 |
Smalltalk at:#ExternalLibraryFunction:Verbose put:true.
|
|
30 |
Smalltalk at:#ObjectFileLoader:Verbose put:true.
|
|
31 |
"/
|
|
32 |
"/ this will already perform a number of calls into OLE,
|
|
33 |
"/ to get the CLSIDs of various wellknown interfaces
|
|
34 |
"/ (see OLEInterfaceConstants initialize)
|
|
35 |
Smalltalk loadPackage:'exept:ole'.
|
|
36 |
|
|
37 |
"/ so when we arrive here without error, some is already known to work..
|
|
38 |
self assert:(OLEInterfaceConstants notNil).
|
|
39 |
|
|
40 |
iid_IEnum := OLEInterfaceConstants classVarAt:#'IID_IEnum'.
|
|
41 |
self assert:(iid_IEnum notNil).
|
|
42 |
self assert:(iid_IEnum class == GUID).
|
|
43 |
self assert:(iid_IEnum printString = '{2AE64960-CDDD-101C-9029-040224007802}').
|
|
44 |
|
|
45 |
"
|
|
46 |
self new test00_loadOLE
|
|
47 |
"
|
1356
|
48 |
!
|
|
49 |
|
|
50 |
test01_SysAllocString
|
|
51 |
|ole rslt bstr|
|
|
52 |
|
|
53 |
ole := OLEAutomationDLL current.
|
|
54 |
rslt := ole SysAllocString: 'hello World'.
|
|
55 |
|
|
56 |
self assert:(rslt notNil).
|
|
57 |
bstr := BSTR atAddress:rslt.
|
|
58 |
self halt.
|
|
59 |
|
|
60 |
"
|
|
61 |
self new test01_SysAllocString
|
|
62 |
"
|
1353
|
63 |
! !
|
|
64 |
|
|
65 |
!Win32OLETests class methodsFor:'documentation'!
|
|
66 |
|
|
67 |
version
|
|
68 |
^ '$Header$'
|
|
69 |
!
|
|
70 |
|
|
71 |
version_CVS
|
|
72 |
^ '$Header$'
|
|
73 |
! !
|
|
74 |
|