Пример #1
0
 def setUp(self):
     #struct scorecard{
     #   char name[40];
     #   uint32_t p_id;
     #   uint8_t points[42];
     #   uint32_t ranking;
     #}
     self.teststr = ('Jonny Normal' + ('\x00' * 28)
                     + '\x2e\x01\x00\x00'
                     + '\x00\x01\x05\x05\x10\x08\x18' + ('\x00' * 35)
                     + '\x04\x00\x00\x00')
     # That means Jonny Normal, id = 302, 7 games played with
     # with [0, 1, 5, 5, 16, 8, 24] points on them, ranked 4th
     self.buf = d.strbuf(self.teststr)
Пример #2
0
 def setUp(self):
     self.teststr = 'In God we trust. The rest, we test!'
     self.buf = d.strbuf(self.teststr)