MCPcopy Index your code
hub / github.com/qilingframework/qiling / test_volatile_ref

Method test_volatile_ref

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

Source from the content-addressed store, hash-verified

133 self.assertEqual(expected, Wrapper.StructTest.__to_uint(data))
134
135 def test_volatile_ref(self):
136 dummy = DummyStruct.volatile_ref(self.mem, self.ptr)
137
138 expected = 0x01030307
139 dummy.A = expected
140 data = self.__read_data(DummyStruct.offsetof('A'), 4)
141 self.assertEqual(expected, Wrapper.StructTest.__to_uint(data))
142
143 self.assertEqual(self.expected['B'], dummy.B)
144 self.assertEqual(self.expected['C'], dummy.C)
145
146 expected = b'Volatility Test!'
147 self.__write_data(DummyStruct.offsetof('D'), expected)
148 self.assertEqual(expected, dummy.D)
149
150 def test_volatile_ref_internal(self):
151 dummy = DummyStruct.volatile_ref(self.mem, self.ptr)

Callers

nothing calls this directly

Calls 5

__read_dataMethod · 0.95
__write_dataMethod · 0.95
volatile_refMethod · 0.80
offsetofMethod · 0.80
__to_uintMethod · 0.80

Tested by

no test coverage detected