1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-04-24 12:43:10 -07:00
parent c53ce7042b
commit d7e43b1a2c
6 changed files with 18 additions and 23 deletions

View file

@ -3753,13 +3753,13 @@ public class AST2TemplateTests extends AST2TestBase {
// }
public void testTypedefPreservation_380498_1() throws Exception {
BindingAssertionHelper ba= getAssertionHelper();
ICPPVariable s1 = ba.assertNonProblem("s1", ICPPVariable.class);
ICPPVariable s1 = ba.assertNonProblem("s1");
assertTrue(s1.getType() instanceof ITypedef);
assertEquals("string", ((ITypedef) s1.getType()).getName());
ICPPVariable s2 = ba.assertNonProblem("s2", ICPPVariable.class);
ICPPVariable s2 = ba.assertNonProblem("s2");
assertTrue(s2.getType() instanceof ITypedef);
assertEquals("string", ((ITypedef) s2.getType()).getName());
ICPPVariable s3 = ba.assertNonProblem("s3", ICPPVariable.class);
ICPPVariable s3 = ba.assertNonProblem("s3");
assertTrue(s3.getType() instanceof ITypedef);
assertEquals("string", ((ITypedef) s3.getType()).getName());
}
@ -6267,7 +6267,7 @@ public class AST2TemplateTests extends AST2TestBase {
ICPPTemplateParameter aliasParameterT= templateParameterAlias.getTemplateParameters()[0];
assertEquals(1, aliasParameterT.getTemplateNestingLevel());
ICPPAliasTemplateInstance aliasIntInstance = bh.assertNonProblem("Alias<int>", ICPPAliasTemplateInstance.class);
ICPPAliasTemplateInstance aliasIntInstance = bh.assertNonProblem("Alias<int>");
IType typeOfAliasIntInstance = aliasIntInstance.getType();
assertTrue(typeOfAliasIntInstance instanceof ICPPBasicType);
assertEquals(((ICPPBasicType)typeOfAliasIntInstance).getKind(), IBasicType.Kind.eInt);
@ -7019,7 +7019,7 @@ public class AST2TemplateTests extends AST2TestBase {
// const bool B = has_type<int>::value;
public void testSFINAEInNestedTypeInTemplateArgument_402257() throws Exception {
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
ICPPVariable B = helper.assertNonProblem("B", ICPPVariable.class);
ICPPVariable B = helper.assertNonProblem("B");
Long val = B.getInitialValue().numericalValue();
assertNotNull(val);
assertEquals(0 /* false */, val.longValue());
@ -7461,7 +7461,7 @@ public class AST2TemplateTests extends AST2TestBase {
// constexpr int bar = foo<int, double>::i;
public void testSizeofParameterPackOnTypeid_401973() throws Exception {
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
ICPPVariable bar = helper.assertNonProblem("bar", ICPPVariable.class);
ICPPVariable bar = helper.assertNonProblem("bar");
Long barValue = bar.getInitialValue().numericalValue();
assertNotNull(barValue);
assertEquals(2, barValue.longValue());
@ -7571,7 +7571,7 @@ public class AST2TemplateTests extends AST2TestBase {
// }
public void testUnqualifiedFunctionCallInTemplate_402498c() throws Exception {
BindingAssertionHelper helper = new BindingAssertionHelper(getAboveComment(), true);
ICPPVariable x = helper.assertNonProblem("x", ICPPVariable.class);
ICPPVariable x = helper.assertNonProblem("x");
// We really should assert that x's type is a ProblemType, but the semantic
// analyzer is too lenient and makes it a TypeOfDependentExpression if it
// can't instantiate the return type of foo() properly.

View file

@ -103,7 +103,7 @@ public class AST2TestBase extends BaseTestCase {
public final static String TEST_CODE = "<testcode>";
protected static final IParserLogService NULL_LOG = new NullLogService();
protected static boolean sValidateCopy;
protected static class CommonTypes {
public static IType int_ = new CPPBasicType(Kind.eInt, 0);
public static IType pointerToInt = new CPPPointerType(int_);
@ -748,7 +748,7 @@ public class AST2TestBase extends BaseTestCase {
assertTrue("ProblemBinding for name: " + name, !(binding instanceof IProblemBinding));
return assertType(binding, cs);
}
public void assertVariableType(String variableName, IType expectedType) {
IVariable var = assertNonProblem(variableName, IVariable.class);
assertSameType(expectedType, var.getType());

View file

@ -60,9 +60,9 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
public static final ASTNodeProperty NAME = new ASTNodeProperty(
"ICPPASTBaseSpecifier.NAME - Name of base class"); //$NON-NLS-1$
public static final int v_public = 1;
public static final int v_protected = 2;
public static final int v_private = 3;
public static final int v_public = ICPPASTVisibilityLabel.v_public;
public static final int v_protected = ICPPASTVisibilityLabel.v_protected;
public static final int v_private = ICPPASTVisibilityLabel.v_private;
/**
* Returns whether this specifies a virtual base.
@ -108,17 +108,16 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
}
/**
* Get the base specifiers.
* Returns the base specifiers.
*
* @return <code>ICPPASTBaseSpecifier []</code>
*/
public ICPPASTBaseSpecifier[] getBaseSpecifiers();
/**
* Add a base specifier.
* Adds a base specifier.
*
* @param baseSpec
* <code>ICPPASTBaseSpecifier</code>
* @param baseSpec <code>ICPPASTBaseSpecifier</code>
*/
public void addBaseSpecifier(ICPPASTBaseSpecifier baseSpec);

View file

@ -13,8 +13,7 @@ package org.eclipse.cdt.core.dom.ast.cpp;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
/**
* C++ allows for visibility labels to be mixed interdeclaration in class
* specifiers.
* C++ allows for visibility labels to be mixed with declarations in class specifiers.
*
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.

View file

@ -87,9 +87,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
}
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMember#getVisibility()
*/
@Override
public int getVisibility() {
IASTDeclaration decl = getPrimaryDeclaration();

View file

@ -16,8 +16,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBas
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
/**
* Enum that represents C++ visibilities, with methods to convert to
* and from ICPPASTVisiblityLabel.
* Enum that represents C++ visibilities, with methods to convert to and from ICPPASTVisiblityLabel.
*/
public enum VisibilityEnum {
// The values are ordered by increasing visibility.