def test_pointerKernelStyle(self): tested = parsecpp.VariableDeclaration('int * a', asterixInFirstColum=False) self.assertEquals(tested.colums()[0], 'int') self.assertEquals(tested.colums()[1], '* a')
def test_pointer(self): tested = parsecpp.VariableDeclaration('int * a') self.assertEquals(tested.colums()[0], 'int *') self.assertEquals(tested.colums()[1], 'a')
def test_reference(self): tested = parsecpp.VariableDeclaration('int & a') self.assertEquals(tested.colums()[0], 'int &') self.assertEquals(tested.colums()[1], 'a')
def test_default(self): tested = parsecpp.VariableDeclaration('int a = 3') self.assertEquals(tested.colums()[0], 'int') self.assertEquals(tested.colums()[1], 'a = 3')
def test_array(self): tested = parsecpp.VariableDeclaration('int a[ kuki ]') self.assertEquals(tested.colums()[0], 'int') self.assertEquals(tested.colums()[1], 'a[ kuki ]')
def test_trivialSplit(self): tested = parsecpp.VariableDeclaration('int a') self.assertEquals(tested.colums()[0], 'int') self.assertEquals(tested.colums()[1], 'a')
def argumentsTwoColumTable(self): arguments = self._argumentsExpressions() colums = [parsecpp.VariableDeclaration(a).colums() for a in arguments] return colums
def memberTwoColumTable(self): members = self._memberExpressions() colums = [parsecpp.VariableDeclaration(m).colums() for m in members] return colums