Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivian Kong2010-05-12 13:19:17 -0400
committerVivian Kong2010-05-12 13:19:17 -0400
commit1b9307791131081a28cfb855a6484226911192ad (patch)
tree6acbfd8e67b0bdae422b091a21758df38f6fc3eb /xlc/org.eclipse.cdt.core.lrparser.xlc.tests
parent7411fe3feaa03f30c11ba79e1290451be9f7e8fd (diff)
downloadorg.eclipse.cdt-1b9307791131081a28cfb855a6484226911192ad.tar.gz
org.eclipse.cdt-1b9307791131081a28cfb855a6484226911192ad.tar.xz
org.eclipse.cdt-1b9307791131081a28cfb855a6484226911192ad.zip
Bug 312658 - Some c/c++ syntax cause content assist hanging, such as try-catch and do-while(head stream) - fix by John Liu
Diffstat (limited to 'xlc/org.eclipse.cdt.core.lrparser.xlc.tests')
-rw-r--r--xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/base/XlcCompletionHangingTest.java43
-rw-r--r--xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/base/XlcLRParserTestSuite.java3
2 files changed, 45 insertions, 1 deletions
diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/base/XlcCompletionHangingTest.java b/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/base/XlcCompletionHangingTest.java
new file mode 100644
index 0000000000..c56f352d4e
--- /dev/null
+++ b/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/base/XlcCompletionHangingTest.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.core.parser.xlc.tests.base;
+
+import junit.framework.TestSuite;
+
+import org.eclipse.cdt.core.lrparser.tests.AbstractLRHangingTest;
+import org.eclipse.cdt.core.lrparser.tests.LRCompletionHangingTest;
+import org.eclipse.cdt.core.lrparser.xlc.XlcCLanguage;
+import org.eclipse.cdt.core.lrparser.xlc.XlcCPPLanguage;
+
+public class XlcCompletionHangingTest extends LRCompletionHangingTest{
+
+
+ public static TestSuite suite() {
+ return new TestSuite(XlcCompletionHangingTest.class);
+ }
+
+
+ protected XlcCLanguage getCLanguage() {
+ return XlcCLanguage.getDefault();
+ }
+
+ protected XlcCPPLanguage getCPPLanguage() {
+ return XlcCPPLanguage.getDefault();
+ }
+
+ public void testCompletionXlc() throws Exception {
+
+ String code =
+ " __static_assert" + CONTENT_ASIST_CURSOR +"(a>" + CONTENT_ASIST_CURSOR +"b, \"no 64-bit support\"); \n"+
+ " vector " + CONTENT_ASIST_CURSOR +"unsigned " + CONTENT_ASIST_CURSOR +"int d = ++a; \n";
+ runTestCase(code, getCPPLanguage());
+ }
+}
diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/base/XlcLRParserTestSuite.java b/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/base/XlcLRParserTestSuite.java
index 0778b1c27f..d612bcd459 100644
--- a/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/base/XlcLRParserTestSuite.java
+++ b/xlc/org.eclipse.cdt.core.lrparser.xlc.tests/src/org/eclipse/cdt/core/parser/xlc/tests/base/XlcLRParserTestSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2010 IBM Corporation 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
@@ -54,6 +54,7 @@ public class XlcLRParserTestSuite extends TestSuite {
addTest(XlcLRTests.suite()); // has some tests that do fail
addTest(XlcLRUtilOldTests.suite());
addTest(XlcLRUtilTests.suite());
+ addTest(XlcCompletionHangingTest.suite());
addTest(XlcLRCPPImplicitNameTests.suite());
//addTest(LRInactiveCodeTests.suite());

Back to the top