Update copyright year to 2014 by running admin/update-copyright.
[emacs.git] / test / cedet / tests / testdoublens.cpp
blob7ecfc422cd00aff36572c0ce05930bf4a337b142
1 // testdoublens.cpp --- semantic-ia-utest completion engine unit tests
3 // Copyright (C) 2008-2014 Free Software Foundation, Inc.
5 // Author: Eric M. Ludlam <eric@siege-engine.com>
7 // This file is part of GNU Emacs.
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.
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.
19 // You should have received a copy of the GNU General Public License
20 // along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 #include "testdoublens.hpp"
24 namespace Name1 {
25 namespace Name2 {
27 Foo::Foo()
29 p// -1-
30 // #1# ( "pMumble" "publishStuff" )
34 int Foo::get() // ^1^
36 p// -2-
37 // #2# ( "pMumble" "publishStuff" )
39 return 0;
42 void Foo::publishStuff(int /* a */, int /* b */) // ^2^
46 void Foo::sendStuff(int /* a */, int /* b */) // ^3^
50 } // namespace Name2
51 } // namespace Name1
53 // Test multiple levels of metatype expansion
54 int test_fcn () {
55 stage3_Foo MyFoo;
57 MyFoo.// -3-
58 // #3# ( "Mumble" "get" )
61 Name1::Name2::F//-4-
62 // #4# ( "Foo" )
65 // @TODO - get this working...
66 Name1::stage2_Foo::M//-5-
67 /// #5# ( "Mumble" )
71 stage3_Foo foo_fcn() {
72 // Can we go "up" to foo with senator-go-to-up-reference?
76 // Second test from Ravikiran Rajagopal
78 namespace A {
79 class foo {
80 public:
81 void aa();
82 void bb();
85 namespace A {
86 class bar {
87 public:
88 void xx();
89 public:
90 foo myFoo;
93 void bar::xx()
95 myFoo.// -6- <--- cursor is here after the dot
96 // #6# ( "aa" "bb" )
101 // Double namespace example from Hannu Koivisto
103 // This is tricky because the parent class "Foo" is found within the
104 // scope of B, so the scope calculation needs to put that together
105 // before searching for parents in scope.
106 namespace a {
107 namespace b {
109 class Bar : public Foo
111 int baz();
114 int Bar::baz()
116 return dum// -7-
117 // #7# ( "dumdum" )
121 } // namespace b
122 } // namespace a
124 // Three namespace example from Hannu Koivisto
126 // This one is special in that the name e::Foo, where "e" is in
127 // the scope, and not referenced from the global namespace. This
128 // wasn't previously handled, so the fullscope needed to be added
129 // to the list of things searched when in split-name decent search mode
130 // for scopes.
132 namespace d {
133 namespace e {
135 class Foo
137 public:
138 int write();
141 } // namespace d
142 } // namespace e
145 namespace d {
146 namespace f {
148 class Bar
150 public:
151 int baz();
153 private:
154 e::Foo &foo;
157 int Bar::baz()
159 return foo.w// -8-
160 // #8# ( "write" )
164 } // namespace f
165 } // namespace d