diff --git a/comtypes/test/test_dispifc_safearrays.py b/comtypes/test/test_dispifc_safearrays.py index 08694d12..e00d3cbe 100644 --- a/comtypes/test/test_dispifc_safearrays.py +++ b/comtypes/test/test_dispifc_safearrays.py @@ -84,6 +84,24 @@ def test_in_safearray(self): # modifies the safearray on the server side. self.assertEqual(sa.unpack(), unpacked_content) + def test_in_safearray2(self): + for sa, expected, unpacked_content in [ + ( + self._create_consecutive_array().contents, + True, + self.UNPACKED_CONSECUTIVE_VALS, + ), + # Also perform the inverted test. For this, create a safearray with zeros. + ( + self._create_zero_array().contents, + False, + self.UNPACKED_ZERO_VALS, + ), + ]: + with self.subTest(expected=expected, unpacked_content=unpacked_content): + self.assertEqual(self._create_dispifc().VerifyArray(sa), expected) + self.assertEqual(pointer(sa).unpack(), unpacked_content) + if __name__ == "__main__": unittest.main()