diff options
author | Andrew Niefer | 2004-11-18 21:09:43 +0000 |
---|---|---|
committer | Andrew Niefer | 2004-11-18 21:09:43 +0000 |
commit | 7d6aa41cb58fb11171b59c7c413e31bdf7f70a4b (patch) | |
tree | a89715c13b7cf948631bf8ac0c960f062b34472b | |
parent | 235b6312f0ec4fa76ae43dbb397daa402c9771a9 (diff) | |
download | org.eclipse.cdt-7d6aa41cb58fb11171b59c7c413e31bdf7f70a4b.tar.gz org.eclipse.cdt-7d6aa41cb58fb11171b59c7c413e31bdf7f70a4b.tar.xz org.eclipse.cdt-7d6aa41cb58fb11171b59c7c413e31bdf7f70a4b.zip |
fix failing content assist tests
-rw-r--r-- | core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/ContentAssistTests.java | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/ContentAssistTests.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/ContentAssistTests.java index 0af6158ede3..d6e4526a79f 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/ContentAssistTests.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist/ContentAssistTests.java @@ -53,7 +53,7 @@ public class ContentAssistTests extends TestCase { static IWorkspace workspace; static IProject project; static FileManager fileManager; - + static boolean disabledHelpContributions = false; { (CCorePlugin.getDefault().getCoreModel().getIndexManager()).reset(); monitor = new NullProgressMonitor(); @@ -66,18 +66,6 @@ public class ContentAssistTests extends TestCase { project = cPrj.getProject(); project.setSessionProperty(IndexManager.activationKey,new Boolean(false)); - - //disable the help books so we don't get proposals we weren't expecting - CHelpBookDescriptor helpBooks[]; - helpBooks = CHelpProviderManager.getDefault().getCHelpBookDescriptors(new ICHelpInvocationContext(){ - public IProject getProject(){return project;} - public ITranslationUnit getTranslationUnit(){return null;} - } - ); - for( int i = 0; i < helpBooks.length; i++ ){ - if( helpBooks[i] != null ) - helpBooks[i].enable( false ); - } } catch ( CoreException e ) { /*boo*/ } @@ -99,6 +87,20 @@ public class ContentAssistTests extends TestCase { super(name); } + private void disableContributions (){ + //disable the help books so we don't get proposals we weren't expecting + CHelpBookDescriptor helpBooks[]; + helpBooks = CHelpProviderManager.getDefault().getCHelpBookDescriptors(new ICHelpInvocationContext(){ + public IProject getProject(){return project;} + public ITranslationUnit getTranslationUnit(){return null;} + } + ); + for( int i = 0; i < helpBooks.length; i++ ){ + if( helpBooks[i] != null ) + helpBooks[i].enable( false ); + } + } + public static Test suite() { TestSuite suite = new TestSuite( ContentAssistTests.class ); suite.addTest( new ContentAssistTests("cleanupProject") ); //$NON-NLS-1$ @@ -146,7 +148,10 @@ public class ContentAssistTests extends TestCase { return file; } - protected ICompletionProposal[] getResults( IFile file, int offset ) throws Exception { + protected ICompletionProposal[] getResults( IFile file, int offset ) throws Exception { + if( !disabledHelpContributions ) + disableContributions(); + ITranslationUnit tu = (ITranslationUnit)CoreModel.getDefault().create( file ); String buffer = tu.getBuffer().getContents(); IWorkingCopy wc = null; |