From d0826aac61a811c5fc9c2dc6de8955c8fdd969be Mon Sep 17 00:00:00 2001 From: Thomas Geppert Date: Fri, 28 Jun 2024 18:28:05 +0200 Subject: [PATCH] Removed unused import of 'ctypes.byref'. Added values for the 'answer' and 'needs_clarification' fields of the 'StructRecordParamTest' structure and included them in the assertion testing. --- comtypes/test/test_midl_safearray_create.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/comtypes/test/test_midl_safearray_create.py b/comtypes/test/test_midl_safearray_create.py index 093724b0..d632b5e7 100644 --- a/comtypes/test/test_midl_safearray_create.py +++ b/comtypes/test/test_midl_safearray_create.py @@ -1,6 +1,6 @@ # coding: utf-8 -from ctypes import byref, c_int, pointer, POINTER +from ctypes import c_int, pointer, POINTER import unittest import comtypes @@ -64,7 +64,9 @@ def test_record(self): *StructRecordParamTest._recordinfo_ ) record = StructRecordParamTest() + record.question = "The meaning of life, the universe and everything?" record.answer = 42 + record.needs_clarification = True sa_type = comtypes.safearray._midlSAFEARRAY(StructRecordParamTest) for ptn, sa in [ ("with extra", sa_type.create([record], extra=extra)), @@ -73,7 +75,12 @@ def test_record(self): with self.subTest(ptn=ptn): (unpacked,) = sa.unpack() self.assertIsInstance(unpacked, StructRecordParamTest) + self.assertEqual( + unpacked.question, + "The meaning of life, the universe and everything?", + ) self.assertEqual(unpacked.answer, 42) + self.assertEqual(unpacked.needs_clarification, True) def test_ctype(self): extra = None