def testGenerateString16Field(self): self.assertEquals( 'const wchar_t* const foo_bar', GenerateField({ 'type': 'string16', 'field': 'foo_bar' }))
def testGenerateStringField(self): self.assertEquals( 'const char* const bar_foo', GenerateField({ 'type': 'string', 'field': 'bar_foo' }))
def testGenerateClassField(self): self.assertEquals( 'const absl::optional<bool> bar', GenerateField({ 'type': 'class', 'field': 'bar', 'ctype': 'absl::optional<bool>' }))
def testGenerateEnumField(self): self.assertEquals( 'const MyEnumType foo_foo', GenerateField({ 'type': 'enum', 'field': 'foo_foo', 'ctype': 'MyEnumType' }))
def testGenerateArrayField(self): self.assertEquals( 'const int * bar_bar;\n' ' const size_t bar_bar_size', GenerateField({ 'type': 'array', 'field': 'bar_bar', 'contents': { 'type': 'int' } }))
def testGenerateIntField(self): self.assertEquals('const int foo_bar', GenerateField({'type': 'int', 'field': 'foo_bar'}))