MCPcopy Create free account
hub / github.com/qilingframework/qiling / test_wchar

Method test_wchar

tests/test_struct.py:171–183  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

169
170 @unittest.skip('broken wchar implementation')
171 def test_wchar(self):
172 wchar_enc = self.WCHAR_ENC
173 wchar_size = len('\x00'.encode(wchar_enc))
174
175 field_type = ctypes.c_wchar # TODO: replace ctypes.c_wchar with an alternate implementation
176 field_data = 'A'
177 self.assertEqual(len(field_data) * wchar_size, ctypes.sizeof(field_type))
178
179 obj = field_type(field_data)
180 self.assertEqual(field_data, obj.value)
181
182 obj_bytes = bytes(obj)
183 self.assertEqual(field_data.encode(wchar_enc), obj_bytes)
184
185 @unittest.skip('broken wchar implementation')
186 def test_wchar_array(self):

Callers

nothing calls this directly

Calls 1

sizeofMethod · 0.80

Tested by

no test coverage detected