Skip to content

Commit 65eb423

Browse files
committed
Add test code
1 parent 6ad5737 commit 65eb423

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

comtypes/test/test_midl_safearray_create.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding: utf-8
22

3-
from ctypes import c_int, pointer, POINTER
3+
from ctypes import c_int, pointer, HRESULT, POINTER
44
import unittest
55

66
import comtypes
@@ -82,6 +82,14 @@ def test_record(self):
8282
self.assertEqual(unpacked.answer, 42)
8383
self.assertEqual(unpacked.needs_clarification, True)
8484

85+
def test_HRESULT(self):
86+
hr = HRESULT(1)
87+
sa_type = comtypes.safearray._midlSAFEARRAY(HRESULT)
88+
with self.assertRaises(TypeError):
89+
sa_type.create([hr], extra=None)
90+
with self.assertRaises(TypeError):
91+
sa_type.create([hr])
92+
8593
def test_ctype(self):
8694
extra = None
8795
cdata = c_int(1)

0 commit comments

Comments
 (0)