TypeUtil { public static IType removeQualifiers(IType type) { while (type instanceof IQualifierType) { type = ((IQualifierType) type).getType(); } return type; }  static IType getPointerToType(IType type); static IType removeQualifiers(IType type); static boolean isIBasicType(IType type, IBasicType.Kind kind); static IBasicType asIBasicType(IType type, IBasicType.Kind... kinds); static IASTLiteralExpression asIASTLiteralExpression(IASTNode node, int... kinds); static IType resolveOuterTypedef(IType type); static int bytesOfType(IType type, AnalysisEnvironment assumptions); static int bytesOfType(IASTDeclSpecifier spec, AnalysisEnvironment assumptions);  }
@Test public void testRemoveQualifiers() { IASTFunctionDefinition mainFunctionDefinition = (IASTFunctionDefinition) declarationsInFile.get(0); IASTCompoundStatement body = (IASTCompoundStatement) mainFunctionDefinition.getBody(); IASTStatement[] statements = body.getStatements(); assertTrue(statements[2] instanceof IASTExpressionStatement); IASTExpression expr = ((IASTExpressionStatement) statements[2]).getExpression(); assertTrue(expr instanceof IASTFunctionCallExpression); IASTFunctionCallExpression fce = (IASTFunctionCallExpression) expr; assertSame(fce.getArguments().length, 1); assertTrue(fce.getArguments()[0] instanceof IASTLiteralExpression); IASTLiteralExpression arg0 = (IASTLiteralExpression) fce.getArguments()[0]; assertSame(arg0.getKind(), IASTLiteralExpression.lk_string_literal); assertTrue(arg0.getExpressionType() instanceof IPointerType); IPointerType arg0Type = (IPointerType) arg0.getExpressionType(); assertTrue(arg0Type.getType() instanceof IQualifierType); assertTrue(TypeUtil.removeQualifiers(arg0Type.getType()) instanceof IBasicType); }