Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 54881 Details for
Bug 158192
indexing failures due to MSVC extensions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
test cases for this
patch158192.txt (text/plain), 3.71 KB, created by
Andrew Ferguson
on 2006-12-01 07:33:15 EST
(
hide
)
Description:
test cases for this
Filename:
MIME Type:
Creator:
Andrew Ferguson
Created:
2006-12-01 07:33:15 EST
Size:
3.71 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.core.tests >Index: parser/org/eclipse/cdt/core/parser/tests/ast2/CompleteParser2Tests.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CompleteParser2Tests.java,v >retrieving revision 1.24 >diff -u -r1.24 CompleteParser2Tests.java >--- parser/org/eclipse/cdt/core/parser/tests/ast2/CompleteParser2Tests.java 15 Jul 2005 14:08:16 -0000 1.24 >+++ parser/org/eclipse/cdt/core/parser/tests/ast2/CompleteParser2Tests.java 1 Dec 2006 11:10:49 -0000 >@@ -61,6 +61,7 @@ > import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace; > import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType; > import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration; >+import org.eclipse.cdt.core.dom.ast.cpp.ICPPVariable; > import org.eclipse.cdt.core.parser.CodeReader; > import org.eclipse.cdt.core.parser.IScanner; > import org.eclipse.cdt.core.parser.NullLogService; >@@ -2575,6 +2576,63 @@ > writer.write("#define A( a, b ) a ## b \n"); //$NON-NLS-1$ > writer.write("#define FOOBAR 1 \n"); //$NON-NLS-1$ > writer.write("int i = A( FOO, BAR ); \n"); //$NON-NLS-1$ >- parse( writer.toString() ); >+ parse( writer.toString(), true, ParserLanguage.CPP ); >+ } >+ >+ public void test158192_declspec_on_class() throws Exception { >+ Writer writer = new StringWriter(); >+ writer.write("class __declspec(foobar) Foo1 {};\n"); >+ writer.write("union __declspec(foobar) Foo2 {};\n"); >+ writer.write("struct __declspec(foobar) Foo3 {};\n"); >+ IASTTranslationUnit tu = parse( writer.toString(), true, ParserLanguage.CPP, true ); >+ >+ CPPNameCollector col = new CPPNameCollector(); >+ tu.accept( col ); >+ >+ assertEquals( 3, col.size()); >+ ICompositeType fooClass = (ICompositeType) col.getName(0).resolveBinding(); >+ ICompositeType fooUnion = (ICompositeType) col.getName(1).resolveBinding(); >+ ICompositeType fooStruct = (ICompositeType) col.getName(2).resolveBinding(); >+ >+ assertEquals(ICPPClassType.k_class, fooClass.getKey()); >+ assertEquals(ICompositeType.k_union, fooUnion.getKey()); >+ assertEquals(ICompositeType.k_struct, fooStruct.getKey()); >+ >+ assertInstances(col, fooClass, 1); >+ assertInstances(col, fooUnion, 1); >+ assertInstances(col, fooStruct, 1); > } >+ >+ public void test158192_declspec_on_variable() throws Exception { >+ Writer writer = new StringWriter(); >+ writer.write("__declspec(foobar) class Foo {} bar;\n"); >+ IASTTranslationUnit tu = parse( writer.toString(), true, ParserLanguage.CPP, true); >+ >+ CPPNameCollector col = new CPPNameCollector(); >+ tu.accept( col ); >+ >+ assertEquals( 2, col.size()); >+ ICompositeType fooClass = (ICompositeType) col.getName(0).resolveBinding(); >+ ICPPVariable bar = (ICPPVariable) col.getName(1).resolveBinding(); >+ >+ assertInstances(col, fooClass, 1); >+ assertInstances(col, bar, 1); >+ } >+ >+// public void test158192_false_positive() throws Exception { >+// Writer writer = new StringWriter(); >+// writer.write("int * __declspec(foo) bar = 0;\n"); >+// IASTTranslationUnit tu = parse( writer.toString(), true, ParserLanguage.CPP, true); >+// >+// IASTProblem [] problems = CPPVisitor.getProblems(tu); >+// assertTrue( problems.length>0 ); >+// >+// CPPNameCollector col = new CPPNameCollector(); >+// tu.accept( col ); >+// >+// assertEquals( 1, col.size()); >+// ICPPVariable bar = (ICPPVariable) col.getName(0).resolveBinding(); >+// >+// assertInstances(col, bar, 1); >+// } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 158192
:
50657
| 54881 |
57608