summaryrefslogtreecommitdiff
path: root/test/manual/cedet/tests/testnsp.cpp
diff options
context:
space:
mode:
authorEric Ludlam <zappo@gnu.org>2019-10-27 20:51:54 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2019-10-31 19:04:12 -0400
commitf69e2aa104209090d5487a7382473ec38b43e9c7 (patch)
treeb63a2c91aab10dfdfafc83531750377c69f2a212 /test/manual/cedet/tests/testnsp.cpp
parent31ed03020c458daabdd8feac741e276a1b7f723b (diff)
downloademacs-f69e2aa104209090d5487a7382473ec38b43e9c7.tar.gz
* test/manual/cedet/tests/test*: More updates from upstream
* test/manual/cedet/tests/testjavacomp.java, test/manual/cedet/tests/testnsp.cpp, test/manual/cedet/tests/testsppcomplete.c, test/manual/cedet/tests/testtypedefs.cpp, test/manual/cedet/tests/testvarnames.c: Merge content from CEDET on SF with extended test points for use with test/lisp/cedet/semantic-utest-ia.el Author: Eric Ludlam <zappo@gnu.org>
Diffstat (limited to 'test/manual/cedet/tests/testnsp.cpp')
-rw-r--r--test/manual/cedet/tests/testnsp.cpp103
1 files changed, 98 insertions, 5 deletions
diff --git a/test/manual/cedet/tests/testnsp.cpp b/test/manual/cedet/tests/testnsp.cpp
index 012dc660600..e6ffd4aacbc 100644
--- a/test/manual/cedet/tests/testnsp.cpp
+++ b/test/manual/cedet/tests/testnsp.cpp
@@ -1,8 +1,24 @@
-// Test NSP (Name space parent)
-//
-// Test dereferencing parents based on local parent scope.
-//
-// Derived from data David Engster provided.
+/* testnsp.cpp --- semantic-ia-utest completion engine unit tests
+
+ Copyright (C) 2008-2019 Free Software Foundation, Inc.
+
+ Author: Eric M. Ludlam <zappo@gnu.org>
+
+ This file is part of GNU Emacs.
+
+ GNU Emacs is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ GNU Emacs is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+*/
namespace nsp {
@@ -27,3 +43,80 @@ void myfcn_not_in_ns (void) {
; // #1# ( "fromchild" "fromroot" )
}
+// Test a class declared in a class, where the contents
+// are in a qualified name.
+//
+// Thanks Michael Reiher for the concise example.
+
+class AAA
+{
+public:
+ AAA();
+
+ void aaa();
+
+private:
+ class Private;
+ Private * const d;
+};
+
+class AAA::Private
+{
+ Private() : bbb(0) {
+ }
+
+ BBB* bbb;
+};
+
+void AAA::aaa()
+{
+ d->// -2-
+ ; // #2# ( "bbb" )
+}
+
+// #include files inside a namespace
+// David Engster <deng@randomsample.de>
+// See revisions 8034-8037 which implement this.
+
+namespace another {
+ #include "testdoublens.hpp"
+}
+
+void foo(void) {
+
+ another::// -3-
+ ; // #3# ( "Name1" "a" "stage3_Foo" )
+
+ another::Name1::Name2::Foo a;
+
+ a.// -4-
+ ; // #4# ( "Mumble" "get" )
+}
+
+// What happens if a type your looking for is scoped withing a type,
+// but you are one level into the completion so the originating scope
+// excludes the type of the variable you are completing through?
+// Thanks Martin Stein for this nice example.
+
+namespace ms_structs
+{
+ struct ms_aaa
+ {
+ int xx;
+ };
+
+ struct ms_bbb
+ {
+ struct ms_aaa yy;
+ };
+};
+
+int fun()
+{
+ using namespace ms_structs;
+ struct ms_bbb mszz;
+ int uu = mszz.// -5-
+ ; // #5# ( "yy" )
+ int kk = mszz.yy.// - 6- @TODO - bring in patch from SF
+ ; // #6# ( "xx" )
+}