diff options
| author | Eric Ludlam | 2019-10-27 20:51:54 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-10-31 19:04:12 -0400 |
| commit | f69e2aa104209090d5487a7382473ec38b43e9c7 (patch) | |
| tree | b63a2c91aab10dfdfafc83531750377c69f2a212 /test/manual/cedet/tests/testnsp.cpp | |
| parent | 31ed03020c458daabdd8feac741e276a1b7f723b (diff) | |
| download | emacs-f69e2aa104209090d5487a7382473ec38b43e9c7.tar.gz emacs-f69e2aa104209090d5487a7382473ec38b43e9c7.zip | |
* 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.cpp | 103 |
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 @@ | |||
| 1 | // Test NSP (Name space parent) | 1 | /* testnsp.cpp --- semantic-ia-utest completion engine unit tests |
| 2 | // | 2 | |
| 3 | // Test dereferencing parents based on local parent scope. | 3 | Copyright (C) 2008-2019 Free Software Foundation, Inc. |
| 4 | // | 4 | |
| 5 | // Derived from data David Engster provided. | 5 | Author: Eric M. Ludlam <zappo@gnu.org> |
| 6 | |||
| 7 | This file is part of GNU Emacs. | ||
| 8 | |||
| 9 | GNU Emacs is free software: you can redistribute it and/or modify | ||
| 10 | it under the terms of the GNU General Public License as published by | ||
| 11 | the Free Software Foundation, either version 3 of the License, or | ||
| 12 | (at your option) any later version. | ||
| 13 | |||
| 14 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | GNU General Public License for more details. | ||
| 18 | |||
| 19 | You should have received a copy of the GNU General Public License | ||
| 20 | along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 21 | */ | ||
| 6 | 22 | ||
| 7 | namespace nsp { | 23 | namespace nsp { |
| 8 | 24 | ||
| @@ -27,3 +43,80 @@ void myfcn_not_in_ns (void) { | |||
| 27 | ; // #1# ( "fromchild" "fromroot" ) | 43 | ; // #1# ( "fromchild" "fromroot" ) |
| 28 | } | 44 | } |
| 29 | 45 | ||
| 46 | // Test a class declared in a class, where the contents | ||
| 47 | // are in a qualified name. | ||
| 48 | // | ||
| 49 | // Thanks Michael Reiher for the concise example. | ||
| 50 | |||
| 51 | class AAA | ||
| 52 | { | ||
| 53 | public: | ||
| 54 | AAA(); | ||
| 55 | |||
| 56 | void aaa(); | ||
| 57 | |||
| 58 | private: | ||
| 59 | class Private; | ||
| 60 | Private * const d; | ||
| 61 | }; | ||
| 62 | |||
| 63 | class AAA::Private | ||
| 64 | { | ||
| 65 | Private() : bbb(0) { | ||
| 66 | } | ||
| 67 | |||
| 68 | BBB* bbb; | ||
| 69 | }; | ||
| 70 | |||
| 71 | void AAA::aaa() | ||
| 72 | { | ||
| 73 | d->// -2- | ||
| 74 | ; // #2# ( "bbb" ) | ||
| 75 | } | ||
| 76 | |||
| 77 | // #include files inside a namespace | ||
| 78 | // David Engster <deng@randomsample.de> | ||
| 79 | // See revisions 8034-8037 which implement this. | ||
| 80 | |||
| 81 | namespace another { | ||
| 82 | #include "testdoublens.hpp" | ||
| 83 | } | ||
| 84 | |||
| 85 | void foo(void) { | ||
| 86 | |||
| 87 | another::// -3- | ||
| 88 | ; // #3# ( "Name1" "a" "stage3_Foo" ) | ||
| 89 | |||
| 90 | another::Name1::Name2::Foo a; | ||
| 91 | |||
| 92 | a.// -4- | ||
| 93 | ; // #4# ( "Mumble" "get" ) | ||
| 94 | } | ||
| 95 | |||
| 96 | // What happens if a type your looking for is scoped withing a type, | ||
| 97 | // but you are one level into the completion so the originating scope | ||
| 98 | // excludes the type of the variable you are completing through? | ||
| 99 | // Thanks Martin Stein for this nice example. | ||
| 100 | |||
| 101 | namespace ms_structs | ||
| 102 | { | ||
| 103 | struct ms_aaa | ||
| 104 | { | ||
| 105 | int xx; | ||
| 106 | }; | ||
| 107 | |||
| 108 | struct ms_bbb | ||
| 109 | { | ||
| 110 | struct ms_aaa yy; | ||
| 111 | }; | ||
| 112 | }; | ||
| 113 | |||
| 114 | int fun() | ||
| 115 | { | ||
| 116 | using namespace ms_structs; | ||
| 117 | struct ms_bbb mszz; | ||
| 118 | int uu = mszz.// -5- | ||
| 119 | ; // #5# ( "yy" ) | ||
| 120 | int kk = mszz.yy.// - 6- @TODO - bring in patch from SF | ||
| 121 | ; // #6# ( "xx" ) | ||
| 122 | } | ||