diff options
author | Mike Kucera | 2009-03-18 13:17:31 +0000 |
---|---|---|
committer | Mike Kucera | 2009-03-18 13:17:31 +0000 |
commit | 88c96a37122c83c5af752c0627df2bb6cf9738ed (patch) | |
tree | 6a317c102c24f3124e6b55fd640a89701dbc162e /core/org.eclipse.cdt.ui.tests | |
parent | 7086a42dea89b5c6f4dcbed6f0b01dfd886f85f7 (diff) | |
download | org.eclipse.cdt-88c96a37122c83c5af752c0627df2bb6cf9738ed.tar.gz org.eclipse.cdt-88c96a37122c83c5af752c0627df2bb6cf9738ed.tar.xz org.eclipse.cdt-88c96a37122c83c5af752c0627df2bb6cf9738ed.zip |
bug 269034, mark occurrences for overloaded operators
Diffstat (limited to 'core/org.eclipse.cdt.ui.tests')
-rw-r--r-- | core/org.eclipse.cdt.ui.tests/resources/ceditor/occurrences.cpp | 2 | ||||
-rw-r--r-- | core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/MarkOccurrenceTest.java | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/resources/ceditor/occurrences.cpp b/core/org.eclipse.cdt.ui.tests/resources/ceditor/occurrences.cpp index c3f7834b32d..5a5bc9d1bec 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/ceditor/occurrences.cpp +++ b/core/org.eclipse.cdt.ui.tests/resources/ceditor/occurrences.cpp @@ -71,6 +71,7 @@ struct CppStruct { union CppUnion { int unionField; + CppUnion operator+(CppUnion); }; typedef CppUnion TUnion; @@ -105,6 +106,7 @@ INT ClassContainer::staticPrivMethod() { CppUnion un; un.unionField= 2; staticPubMethod(staticPubField); + un + un; label: FUNCTION_MACRO(0); if (un.unionField < st->structField) diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/MarkOccurrenceTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/MarkOccurrenceTest.java index 403fd4d60dd..9df501d8f84 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/MarkOccurrenceTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/MarkOccurrenceTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2009 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 @@ -479,6 +479,21 @@ public class MarkOccurrenceTest extends BaseUITestCase { assertOccurrencesInWidget(); } + public void testMarkOperatorOccurrences() { + try { + fMatch= fFindReplaceDocumentAdapter.find(0, "operator+", true, true, true, false); + } catch (BadLocationException e) { + fail(); + } + assertNotNull(fMatch); + + fEditor.selectAndReveal(fMatch.getOffset(), fMatch.getLength()); + + assertOccurrences(2); + assertOccurrencesInWidget(); + } + + public void testNoOccurrencesIfDisabled() { CUIPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.EDITOR_MARK_OCCURRENCES, false); fOccurrences= Integer.MAX_VALUE; |