Home
last modified time | relevance | path

Searched refs:offset (Results 1 – 2 of 2) sorted by relevance

/kernel/tests/net/test/
Dcstruct_test.py145 self.assertEqual(0, t.offset("byte1"))
146 self.assertEqual(1, t.offset("string2")) # sizeof(byte)
147 self.assertEqual(17, t.offset("int3")) # sizeof(byte) + 16*sizeof(char)
151 self.assertEqual(24, t.offset("ascii4"))
152 self.assertEqual(40, t.offset("word5"))
153 self.assertRaises(KeyError, t.offset, "random")
162 self.assertEqual(0, d.offset("nest1"))
163 self.assertEqual(len(TestStructA), d.offset("nest2"))
164 self.assertEqual(len(TestStructA) + len(Nested), d.offset("byte3"))
165 self.assertRaises(KeyError, t.offset, "word1")
Dcstruct.py145 offset = CalcSize(_format[:i]) variable in Struct.CStruct
146 if offset > last_offset:
147 last_offset = offset
148 offset_list.append(offset)
219 def offset(self, name): member in Struct.CStruct