From: Eli Bendersky Date: Mon, 12 Dec 2011 03:26:48 +0000 (+0200) Subject: added some more assertions to test_callframe.py X-Git-Tag: v0.10~41 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=154568a10e3bf4393e8d8b08cbf3223ba21f50c4;p=pyelftools.git added some more assertions to test_callframe.py --- diff --git a/tests/test_callframe.py b/tests/test_callframe.py index 7a45090..d385d37 100644 --- a/tests/test_callframe.py +++ b/tests/test_callframe.py @@ -63,10 +63,29 @@ class TestCallFrame(unittest.TestCase): self.assertEqual(entries[0]['length'], 32) self.assertEqual(entries[0]['data_alignment_factor'], -4) self.assertEqual(entries[0]['return_address_register'], 8) + self.assertEqual(len(entries[0].instructions), 11) self.assertInstruction(entries[0].instructions[0], 'DW_CFA_def_cfa', [7, 0]) + self.assertInstruction(entries[0].instructions[8], + 'DW_CFA_same_value', [7]) + self.assertInstruction(entries[0].instructions[9], + 'DW_CFA_register', [8, 1]) self.assertTrue(isinstance(entries[1], FDE)) + self.assertEqual(entries[1]['length'], 40) + self.assertEqual(entries[1]['CIE_pointer'], 0) + self.assertEqual(entries[1]['address_range'], 84) + self.assertEqual(len(entries[1].instructions), 21) + self.assertInstruction(entries[1].instructions[0], + 'DW_CFA_advance_loc', [1]) + self.assertInstruction(entries[1].instructions[1], + 'DW_CFA_def_cfa_offset', [12]) + self.assertInstruction(entries[1].instructions[9], + 'DW_CFA_offset', [4, 3]) + self.assertInstruction(entries[1].instructions[18], + 'DW_CFA_def_cfa_offset', [0]) + self.assertInstruction(entries[1].instructions[20], + 'DW_CFA_nop', []) if __name__ == '__main__': unittest.main()