Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd committed May 29, 2024
1 parent 3d7c5d3 commit a73399a
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions comtypes/test/test_dispifc_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


@unittest.skipIf(IMPORT_FAILED, "This depends on the out of process COM-server.")
class Test(unittest.TestCase):
class Test_Disp(unittest.TestCase):
"""Test dispmethods with record and record pointer parameters."""

EXPECTED_INITED_QUESTIONS = "The meaning of life, the universe and everything?"
Expand All @@ -31,7 +31,7 @@ def _create_dispifc(self) -> "ComtypesCppTestSrvLib.IDispRecordParamTest":
interface=ComtypesCppTestSrvLib.IDispRecordParamTest,
)

def test_byref(self):
def test_inout_byref(self):
dispifc = self._create_dispifc()
# Passing a record by reference to a method that has declared the parameter
# as [in, out] we expect modifications of the record on the server side to
Expand All @@ -45,7 +45,7 @@ def test_byref(self):
self.assertEqual(test_record.answer, 42)
self.assertEqual(test_record.needs_clarification, True)

def test_pointer(self):
def test_inout_pointer(self):
dispifc = self._create_dispifc()
# Passing a record pointer to a method that has declared the parameter
# as [in, out] we expect modifications of the record on the server side to
Expand All @@ -59,7 +59,18 @@ def test_pointer(self):
self.assertEqual(test_record.answer, 42)
self.assertEqual(test_record.needs_clarification, True)

def test_record(self):
def test_inout_record(self):
dispifc = self._create_dispifc()
test_record = ComtypesCppTestSrvLib.StructRecordParamTest()
self.assertEqual(test_record.question, None)
self.assertEqual(test_record.answer, 0)
self.assertEqual(test_record.needs_clarification, False)
dispifc.InitRecord(test_record)
self.assertEqual(test_record.question, self.EXPECTED_INITED_QUESTIONS)
self.assertEqual(test_record.answer, 42)
self.assertEqual(test_record.needs_clarification, True)

def test_in_record(self):
# Passing a record to a method that has declared the parameter just as [in]
# we expect modifications of the record on the server side NOT to change
# the record on the client side.
Expand Down Expand Up @@ -98,7 +109,7 @@ def _create_dualifc(self) -> "ComtypesCppTestSrvLib.IDualRecordParamTest":
interface=ComtypesCppTestSrvLib.IDualRecordParamTest,
)

def test_internal_byref(self):
def test_inout_record(self):
dualifc = self._create_dualifc()
# Passing a record by reference to a method that has declared the parameter
# as [in, out] we expect modifications of the record on the server side to
Expand All @@ -116,7 +127,7 @@ def test_internal_byref(self):
self.assertEqual(test_record.needs_clarification, True)
faulthandler.disable()

def test_pointer(self):
def test_inout_pointer(self):
dualifc = self._create_dualifc()
# Passing a record pointer to a method that has declared the parameter
# as [in, out] we expect modifications of the record on the server side to
Expand All @@ -130,7 +141,7 @@ def test_pointer(self):
self.assertEqual(test_record.answer, 42)
self.assertEqual(test_record.needs_clarification, True)

def test_record(self):
def test_in_record(self):
# Passing a record to a method that has declared the parameter just as [in]
# we expect modifications of the record on the server side NOT to change
# the record on the client side.
Expand Down

0 comments on commit a73399a

Please sign in to comment.