diff options
author | Marc-Andre Laperle | 2017-02-06 21:22:23 +0000 |
---|---|---|
committer | Marc-André Laperle | 2017-02-14 03:19:56 +0000 |
commit | 0046099052a16c40359b840b6f465f301fed1dd2 (patch) | |
tree | 44e44d29d71b7d385c6e2626c27bbc4396c597d7 /codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java | |
parent | f78a7306b3cf7bf2d5d05fd07d592cedec25f63a (diff) | |
download | org.eclipse.cdt-0046099052a16c40359b840b6f465f301fed1dd2.tar.gz org.eclipse.cdt-0046099052a16c40359b840b6f465f301fed1dd2.tar.xz org.eclipse.cdt-0046099052a16c40359b840b6f465f301fed1dd2.zip |
releng: Make use of Tycho POM-less functionality
This removes a lot of pom.xml from the source tree. This is using the
"POM-less" Tycho functionality.
See
https://wiki.eclipse.org/Tycho/Release_Notes/0.24#POM-less_Tycho_builds
One advantage of this is that you do not need to update the version in
the pom.xml when you change it in the MANIFEST.MF because the pom.xml is
automatically generated. This also reduces a lot of the duplicated
information and pom.xml repetition.
- Maven 3.3 and up is required.
- Only eclipse-plugins and eclipse-features can be pom-less.
Repositories, target and others still have pom.xml.
- New parent poms are added because a parent is necessary directly one
level above the plug-in/feature that will have its pom generated
- Some test plug-ins had to be renamed .test -> .tests because it's
required so that it detects that it's a test plug-in
- Some suites were renamed so that they all use the same consistent name
"AutomatedIntegrationSuite"
- Profiles were added for the more common test configurations. They are
activated by the presence of simple .properties files that only serve to
activate the correct profile. The profiles:
- One for UI tests (UI present and start in UI thread)
- One for SWTBot tests (UI present and do not start in UI thread)
Other test plug-ins that are too different are kept intact and still
have
a pom.xml
- Fragments are kept intact since they all have different target
platform configurations
Change-Id: I9d73380eb766f547830c552daf08053a30b1845c
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Diffstat (limited to 'codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java')
-rw-r--r-- | codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java new file mode 100644 index 00000000000..149785324d9 --- /dev/null +++ b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/core/internal/checkers/ProblemBindingCheckerTest.java @@ -0,0 +1,112 @@ +/******************************************************************************* + * Copyright (c) 2011, 2015 Marc-Andre Laperle and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc-Andre Laperle - Initial API and implementation + * Sergey Prigogin (Google) + *******************************************************************************/ +package org.eclipse.cdt.codan.core.internal.checkers; + +import org.eclipse.cdt.codan.core.tests.CheckerTestCase; +import org.eclipse.cdt.codan.internal.checkers.ProblemBindingChecker; +import org.eclipse.core.resources.IMarker; + +public class ProblemBindingCheckerTest extends CheckerTestCase { + @Override + public boolean isCpp() { + return true; + } + + @Override + public void setUp() throws Exception { + super.setUp(); + enableProblems( + ProblemBindingChecker.ERR_ID_AmbiguousProblem, ProblemBindingChecker.ERR_ID_Candidates, + ProblemBindingChecker.ERR_ID_CircularReferenceProblem, ProblemBindingChecker.ERR_ID_FieldResolutionProblem, + ProblemBindingChecker.ERR_ID_FunctionResolutionProblem, ProblemBindingChecker.ERR_ID_InvalidArguments, + ProblemBindingChecker.ERR_ID_InvalidTemplateArgumentsProblem, ProblemBindingChecker.ERR_ID_LabelStatementNotFoundProblem, + ProblemBindingChecker.ERR_ID_MemberDeclarationNotFoundProblem, ProblemBindingChecker.ERR_ID_MethodResolutionProblem, + ProblemBindingChecker.ERR_ID_OverloadProblem, ProblemBindingChecker.ERR_ID_RedeclarationProblem, + ProblemBindingChecker.ERR_ID_RedefinitionProblem, ProblemBindingChecker.ERR_ID_TypeResolutionProblem, + ProblemBindingChecker.ERR_ID_VariableResolutionProblem); + } + + // int main () { + // struct X {} x; + // fun(x.y); + // } + public void testFieldInFunctionCall_338683() throws Exception { + loadCodeAndRun(getAboveComment()); + checkErrorLine(3, ProblemBindingChecker.ERR_ID_FieldResolutionProblem); + } + + // struct A { + // A(int x, int y); + // }; + // + // void test() { + // A a("hi", 1, 2); + // } + public void testImplicitConstructorCall_404774() throws Exception { + loadCodeAndRun(getAboveComment()); + checkErrorLine(6, ProblemBindingChecker.ERR_ID_InvalidArguments); + } + + // int main () { + // struct X {} x; + // x.b( + // x.y(), + // x.y( + // x.y), + // x.y( + // x.y( + // a, + // fun( + // x.b(), + // x.y, + // a.b())))); + // } + public void testVariousFieldMethodCombinations_338683() throws Exception { + loadCodeAndRun(getAboveComment()); + checkErrorLine(3, ProblemBindingChecker.ERR_ID_MethodResolutionProblem); + checkErrorLine(4, ProblemBindingChecker.ERR_ID_MethodResolutionProblem); + checkErrorLine(5, ProblemBindingChecker.ERR_ID_MethodResolutionProblem); + checkErrorLine(6, ProblemBindingChecker.ERR_ID_FieldResolutionProblem); + checkErrorLine(7, ProblemBindingChecker.ERR_ID_MethodResolutionProblem); + checkErrorLine(8, ProblemBindingChecker.ERR_ID_MethodResolutionProblem); + checkErrorLine(9, ProblemBindingChecker.ERR_ID_VariableResolutionProblem); + checkErrorLine(10, ProblemBindingChecker.ERR_ID_FunctionResolutionProblem); + checkErrorLine(11, ProblemBindingChecker.ERR_ID_MethodResolutionProblem); + checkErrorLine(12, ProblemBindingChecker.ERR_ID_FieldResolutionProblem); + checkErrorLine(13, ProblemBindingChecker.ERR_ID_MethodResolutionProblem); + } + + // #define MACRO(code) code + // int main() { + // MACRO(foo()); + // return 0; + // } + public void testDontUnderlineWholeMacro_341089() throws Exception { + loadCodeAndRun(getAboveComment()); + IMarker marker = checkErrorLine(3, ProblemBindingChecker.ERR_ID_FunctionResolutionProblem); + assertFalse(marker.getAttribute(IMarker.MESSAGE, "").contains("MACRO")); + } + + // auto d = 42_waldo; + public void testNonexistentUDLOperator_484619() throws Exception { + loadCodeAndRun(getAboveComment()); + checkErrorLine(1, ProblemBindingChecker.ERR_ID_FunctionResolutionProblem); + } + + // struct R {}; + // R operator "" _waldo(const char*, unsigned long); // expects a string literal + // auto d = 42_waldo; // passing an integer + public void testUDLOperatorWithWrongType_484619() throws Exception { + loadCodeAndRun(getAboveComment()); + checkErrorLine(3, ProblemBindingChecker.ERR_ID_InvalidArguments); + } +} |