Mercurial > emacs
annotate test/cedet/tests/testdoublens.cpp @ 110726:3d5760c08447
src/makefile.w32-in (TAGS, TAGS-LISP, TAGS-gmake): Add $(FONTOBJ).
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Sun, 03 Oct 2010 14:36:19 +0200 |
parents | 89eccb374dec |
children | 376148b31b5e |
rev | line source |
---|---|
107698
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
1 // testdoublens.cpp --- semantic-ia-utest completion engine unit tests |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
2 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
3 // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
4 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
5 // Author: Eric M. Ludlam <eric@siege-engine.com> |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
6 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
7 // This file is part of GNU Emacs. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
8 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
9 // GNU Emacs is free software: you can redistribute it and/or modify |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
10 // it under the terms of the GNU General Public License as published by |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
11 // the Free Software Foundation, either version 3 of the License, or |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
12 // (at your option) any later version. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
13 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
14 // GNU Emacs is distributed in the hope that it will be useful, |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
17 // GNU General Public License for more details. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
18 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
19 // You should have received a copy of the GNU General Public License |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
20 // along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
21 |
104494 | 22 #include "testdoublens.hpp" |
23 | |
24 namespace Name1 { | |
25 namespace Name2 { | |
26 | |
27 Foo::Foo() | |
28 { | |
29 p// -1- | |
30 // #1# ( "pMumble" "publishStuff" ) | |
31 ; | |
32 } | |
33 | |
34 int Foo::get() // ^1^ | |
35 { | |
36 p// -2- | |
37 // #2# ( "pMumble" "publishStuff" ) | |
38 ; | |
39 return 0; | |
40 } | |
41 | |
42 void Foo::publishStuff(int /* a */, int /* b */) // ^2^ | |
43 { | |
44 } | |
45 | |
46 void Foo::sendStuff(int /* a */, int /* b */) // ^3^ | |
47 { | |
48 } | |
107698
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
49 |
104494 | 50 } // namespace Name2 |
51 } // namespace Name1 | |
52 | |
53 // Test multiple levels of metatype expansion | |
54 int test_fcn () { | |
55 stage3_Foo MyFoo; | |
56 | |
57 MyFoo.// -3- | |
58 // #3# ( "Mumble" "get" ) | |
59 ; | |
60 | |
61 Name1::Name2::F//-4- | |
62 // #4# ( "Foo" ) | |
63 ; | |
107698
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
64 |
104494 | 65 // @TODO - get this working... |
66 Name1::stage2_Foo::M//-5- | |
67 /// #5# ( "Mumble" ) | |
68 ; | |
69 } | |
70 | |
71 stage3_Foo foo_fcn() { | |
72 // Can we go "up" to foo with senator-go-to-up-reference? | |
73 } | |
74 | |
75 | |
76 // Second test from Ravikiran Rajagopal | |
77 | |
107698
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
78 namespace A { |
104494 | 79 class foo { |
80 public: | |
81 void aa(); | |
82 void bb(); | |
83 }; | |
84 } | |
107698
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
85 namespace A { |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
86 class bar { |
104494 | 87 public: |
88 void xx(); | |
89 public: | |
90 foo myFoo; | |
91 }; | |
92 | |
93 void bar::xx() | |
94 { | |
95 myFoo.// -6- <--- cursor is here after the dot | |
96 // #6# ( "aa" "bb" ) | |
97 ; | |
98 } | |
99 } | |
100 | |
101 // Double namespace example from Hannu Koivisto | |
102 // | |
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 { | |
108 | |
109 class Bar : public Foo | |
110 { | |
111 int baz(); | |
112 }; | |
113 | |
114 int Bar::baz() | |
115 { | |
107698
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
116 return dum// -7- |
104494 | 117 // #7# ( "dumdum" ) |
118 ; | |
119 } | |
120 | |
121 } // namespace b | |
122 } // namespace a | |
123 | |
124 // Three namespace example from Hannu Koivisto | |
125 // | |
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. | |
131 | |
132 namespace d { | |
133 namespace e { | |
134 | |
135 class Foo | |
136 { | |
137 public: | |
138 int write(); | |
139 }; | |
140 | |
141 } // namespace d | |
142 } // namespace e | |
143 | |
144 | |
145 namespace d { | |
146 namespace f { | |
147 | |
148 class Bar | |
149 { | |
150 public: | |
151 int baz(); | |
152 | |
153 private: | |
154 e::Foo &foo; | |
155 }; | |
156 | |
157 int Bar::baz() | |
158 { | |
159 return foo.w// -8- | |
160 // #8# ( "write" ) | |
161 ; | |
162 } | |
163 | |
164 } // namespace f | |
165 } // namespace d | |
105377 | 166 |
167 // arch-tag: a185c9f1-7519-48de-8eba-9d9b4140624b |