From 02048cd67fb793face874dd68062a6e25ce71193 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Thu, 29 May 2008 11:16:22 +0000 Subject: [PATCH] Failing tests for bug 206450. --- .../text/contentassist2/CompletionTests.java | 192 +++++++++--------- .../CompletionTests_PlainC.java | 12 ++ 2 files changed, 113 insertions(+), 91 deletions(-) diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java index a465a3ffa62..e17a818fc9e 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java @@ -62,99 +62,103 @@ public class CompletionTests extends AbstractContentAssistTest { // class gnsClass {}; // }; + //{CompletionTest.h} + //class C1; + //class C2; + //class C3; + // + //extern C1* gC1; + //C2* gC2 = 0; + // + //extern C1* gfC1(); + //C2* gfC2(); + // + //enum E1 {e11, e12}; + // + //class C1 { + //public: + // enum E2 {e21, e22}; + // + // C1* fMySelf; + // void iam1(); + // + // C1* m123(); + // C1* m12(); + // C1* m13(); + // + //private: + // void m1private(); + //}; + //typedef C1 T1; + // + // + //class C2 : public T1 { + //public: + // C2* fMySelf; + // void iam2(); + // + // C2* m123(); + // C2* m12(); + // C2* m23(); + // C1* operator()(int x); + // + //private: + // void m2private(); + //}; + //typedef C2 T2; + // + // + //class C3 : public C2 { + //public: + // C3* fMySelf; + // void iam3(); + // + // C3* m123(); + // C3* m13(); + // + // template T tConvert(); + //private: + // void m3private(); + //}; + //typedef C3 T3; + // + //namespace ns { + // const int NSCONST= 1; + // class CNS { + // void mcns(); + // }; + //}; + //template class TClass { + // T fTField; + //public: + // TClass(T tArg) : fTField(tArg) { + // } + // T add(T tOther) { + // return fTField + tOther; + // } + //}; + //// bug 109480 + //class Printer + //{ + //public: + // static void InitPrinter(unsigned char port); + //private: + // //Storage for port printer is on + // static unsigned char port; + //protected: + //}; + //struct Struct1; + //struct Struct2; + //union Union1; + //union Union2; + // struct s206450 { + // struct {int a1; int a2;}; + // union {int u1; char u2;}; + // struct {int a3;} a4; + // int b; + // }; - -//{CompletionTest.h} -//class C1; -//class C2; -//class C3; -// -//extern C1* gC1; -//C2* gC2 = 0; -// -//extern C1* gfC1(); -//C2* gfC2(); -// -//enum E1 {e11, e12}; -// -//class C1 { -//public: -// enum E2 {e21, e22}; -// -// C1* fMySelf; -// void iam1(); -// -// C1* m123(); -// C1* m12(); -// C1* m13(); -// -//private: -// void m1private(); -//}; -//typedef C1 T1; -// -// -//class C2 : public T1 { -//public: -// C2* fMySelf; -// void iam2(); -// -// C2* m123(); -// C2* m12(); -// C2* m23(); -// C1* operator()(int x); -// -//private: -// void m2private(); -//}; -//typedef C2 T2; -// -// -//class C3 : public C2 { -//public: -// C3* fMySelf; -// void iam3(); -// -// C3* m123(); -// C3* m13(); -// -// template T tConvert(); -//private: -// void m3private(); -//}; -//typedef C3 T3; -// -//namespace ns { -// const int NSCONST= 1; -// class CNS { -// void mcns(); -// }; -//}; -//template class TClass { -// T fTField; -//public: -// TClass(T tArg) : fTField(tArg) { -// } -// T add(T tOther) { -// return fTField + tOther; -// } -//}; -//// bug 109480 -//class Printer -//{ -//public: -// static void InitPrinter(unsigned char port); -//private: -// //Storage for port printer is on -// static unsigned char port; -//protected: -//}; -//struct Struct1; -//struct Struct2; -//union Union1; -//union Union2; - public CompletionTests(String name) { super(name, true); } @@ -1156,4 +1160,10 @@ public class CompletionTests extends AbstractContentAssistTest { final String[] expected= {"iam1()"}; assertCompletionResults(expected); } + + // void test() {struct s206450 x; x./*cursor*/ + public void _testNestedAnonymousStructs_Bug206450() throws Exception { + final String[] expected= {"a1", "a2", "u1", "u2", "a4", "b", "s206450"}; + assertCompletionResults(expected); + } } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests_PlainC.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests_PlainC.java index f4166f0aa7e..1212b88869d 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests_PlainC.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests_PlainC.java @@ -136,6 +136,12 @@ public class CompletionTests_PlainC extends AbstractContentAssistTest { //C1* gfC2(); //C1 gC1, gC2; //#endif /* STRUCT_C1 */ + // struct s206450 { + // struct {int a1; int a2;}; + // union {int u1; char u2;}; + // struct {int a3;} a4; + // int b; + // }; //{DisturbWith.c} // int gTemp; @@ -939,4 +945,10 @@ public class CompletionTests_PlainC extends AbstractContentAssistTest { final String[] expected= {"enum0", "enum1", "enum2"}; assertCompletionResults(expected); } + + // void test() {struct s206450 x; x./*cursor*/ + public void _testNestedAnonymousStructs_Bug206450() throws Exception { + final String[] expected= {"a1", "a2", "u1", "u2", "a4", "b"}; + assertCompletionResults(expected); + } }