assertEquals(2, returnStatement.getLineNumber());
}
public void testFunctionWithParameters() throws Exception {
TranslationUnit unit = parse("int foo(int a, int b) { return a + b; }");
FunctionDefinition functionFoo = unit.getChild(0);
assertEquals("foo", functionFoo.getName());
ReturnStatement returnStatement = functionFoo.getChild(0);
assertNotNull(returnStatement);
List<ParameterInfo> parameters = functionFoo.getParameters();
assertEquals(2, parameters.size());
ParameterInfo parameterA = parameters.get(0);
assertEquals("a", parameterA.getName());
assertEquals("int", parameterA.getType().toString());
ParameterInfo parameterB = parameters.get(1);