Exemplo n.º 1
0
 def test_set_name_offset(self):
     sect = UnpreparedElfSection(None, "test")
     self.assertEqual(hasattr(sect, "name_offset"), False) # FIMXE: is this really what we want to check
     sect = sect.prepare(0, 0, 5)
     self.assertEqual(sect.name_offset, 5)
     sect.name_offset = 25
     self.assertEqual(sect.name_offset, 25)
Exemplo n.º 2
0
 def test_data_append(self):
     data = ByteArray("pants")
     sect = UnpreparedElfSection(None, "test", data = data)
     self.assertEquals(sect.get_data(), data)
     sect.append_data(ByteArray("foo"))
     self.assertEquals(sect.get_data(), ByteArray("pantsfoo"))
     sect = sect.prepare(0, 0, 0)
     self.assertEqual(hasattr(sect, "data_append"), False)
Exemplo n.º 3
0
 def test_get_index(self):
     sect = UnpreparedElfSection(None, "test")
     self.assertEqual(hasattr(sect, "get_index"), False)
     sect = sect.prepare(0, 15, 0)
     self.assertEqual(sect.index, 15)
Exemplo n.º 4
0
 def test_get_offset(self):
     sect = UnpreparedElfSection(None, "test")
     self.assertEqual(hasattr(sect, "get_offset"), False)
     sect = sect.prepare(15, 0, 0)
     self.assertEqual(sect.offset, 15)
Exemplo n.º 5
0
 def test_setname_prepared(self):
     sect = UnpreparedElfSection(None, "test")
     self.assertEqual(sect.name, "test")
     sect = sect.prepare(0, 0, 0)
     self.assertEqual(hasattr(sect, "set_name"), False) # FIXME: this isn't the right thing to check