• Home
  • Raw
  • Download

Lines Matching refs:self

32   def testTypedef(self):  argument
42 self.assertEqual(out_file.getvalue(), 'typedef int INT;\n')
43 self.assertIn('INT', defined_types)
51 self.assertRegexpMatches(out_file2.getvalue(), output_re)
52 self.assertIn('TYPE2', defined_types)
56 def testTypedefSerialize(self): argument
64 self.assertIn('INT', serialized_types)
65 self.assertIn('INT2', serialized_types)
68 def testConstant(self): argument
76 self.assertRegexpMatches(out_file.getvalue(), output_re)
79 def testStructure(self): argument
97 self.assertRegexpMatches(out_file.getvalue(), output_re)
99 self.assertIn(t, defined_types)
103 def testStructSerialize(self): argument
118 self.assertIn('TPMU_SYM_MODE', serialized_types)
119 self.assertIn('TEST_STRUCT', serialized_types)
122 def testDefine(self): argument
128 self.assertRegexpMatches(out_file.getvalue(), output_re)
131 def _MakeArg(self, arg_type, arg_name): argument
137 def testCommand(self): argument
140 command.request_args = [self._MakeArg('int', 'input')]
141 command.response_args = [self._MakeArg('char', 'output')]
147 self.assertIn(expected_callback, out_file.getvalue())
152 self.assertIn(expected_serialize, out_file.getvalue())
157 self.assertIn(expected_parse, out_file.getvalue())
162 self.assertIn(expected_async, out_file.getvalue())
167 self.assertIn(expected_sync, out_file.getvalue())
188 def testStructureParserWithBadData(self): argument
194 self.assertIsNotNone(types)
195 self.assertIsNotNone(constants)
196 self.assertIsNotNone(structs)
197 self.assertIsNotNone(defines)
198 self.assertIsNotNone(typemap)
200 def testStructureParser(self): argument
202 input_data = (self.FAKE_TYPEDEF + self.FAKE_CONSTANT + self.FAKE_STRUCTURE +
203 self.FAKE_DEFINE)
208 self.assertGreaterEqual(len(types), 2)
209 self.assertGreaterEqual(len(constants), 1)
210 self.assertGreaterEqual(len(structs), 1)
211 self.assertGreaterEqual(len(defines), 1)
212 self.assertGreaterEqual(len(typemap), 3)
213 self.assertEqual(types[0].old_type, 'type1')
214 self.assertEqual(types[0].new_type, 'type2')
215 self.assertEqual(types[1].old_type, 'base_type')
216 self.assertEqual(types[1].new_type, 'const_type')
217 self.assertEqual(constants[0].const_type, 'const_type')
218 self.assertEqual(constants[0].name, 'const_name')
219 self.assertEqual(constants[0].value, 'const_value')
220 self.assertEqual(structs[0].name, 'struct_type')
221 self.assertEqual(structs[0].is_union, False)
222 self.assertEqual(len(structs[0].fields), 1)
223 self.assertEqual(structs[0].fields[0][0], 'field_type')
224 self.assertEqual(structs[0].fields[0][1], 'field_name[sizeof(depend_type)]')
225 self.assertEqual(len(structs[0].depends_on), 1)
226 self.assertEqual(structs[0].depends_on[0], 'depend_type')
227 self.assertEqual(defines[0].name, 'define_name')
228 self.assertEqual(defines[0].value, 'define_value')
230 def testCommandParserWithBadData(self): argument
236 self.assertIsNotNone(commands)
238 def testCommandParser(self): argument
240 input_data = self.FAKE_COMMAND
244 self.assertEqual(len(commands), 1)
245 self.assertEqual(commands[0].name, 'TPM2_Test')
246 self.assertEqual(commands[0].command_code, 'TPM_CC_Test')
248 self.assertEqual(len(commands[0].request_args), 1)
249 self.assertEqual(commands[0].request_args[0]['type'], 'UINT16')
250 self.assertEqual(commands[0].request_args[0]['name'], 'input')
251 self.assertIsNotNone(commands[0].response_args)
252 self.assertFalse(commands[0].response_args)