aboutsummaryrefslogtreecommitdiffstats
path: root/test/cedet/tests/testdoublens.cpp
diff options
context:
space:
mode:
authorChong Yidong2009-09-28 23:23:31 +0000
committerChong Yidong2009-09-28 23:23:31 +0000
commit74ea13c1a8d63e4f4015e2b9e7e4336e546e7e4a (patch)
treed895d7e93cf93022f48bd6d173f616f1bb4b99fc /test/cedet/tests/testdoublens.cpp
parentb9de0a4665563f847bc7c94f8c89180bf2a9f6bd (diff)
downloademacs-74ea13c1a8d63e4f4015e2b9e7e4336e546e7e4a.tar.gz
emacs-74ea13c1a8d63e4f4015e2b9e7e4336e546e7e4a.zip
Add CEDET tests.
Diffstat (limited to 'test/cedet/tests/testdoublens.cpp')
-rw-r--r--test/cedet/tests/testdoublens.cpp148
1 files changed, 148 insertions, 0 deletions
diff --git a/test/cedet/tests/testdoublens.cpp b/test/cedet/tests/testdoublens.cpp
new file mode 100644
index 00000000000..1cf48761ac7
--- /dev/null
+++ b/test/cedet/tests/testdoublens.cpp
@@ -0,0 +1,148 @@
1//
2// CPP file for semantic-ia-utest
3// completion engine unit tests.
4//
5#include "testdoublens.hpp"
6
7namespace Name1 {
8 namespace Name2 {
9
10 Foo::Foo()
11 {
12 p// -1-
13 // #1# ( "pMumble" "publishStuff" )
14 ;
15 }
16
17 int Foo::get() // ^1^
18 {
19 p// -2-
20 // #2# ( "pMumble" "publishStuff" )
21 ;
22 return 0;
23 }
24
25 void Foo::publishStuff(int /* a */, int /* b */) // ^2^
26 {
27 }
28
29 void Foo::sendStuff(int /* a */, int /* b */) // ^3^
30 {
31 }
32
33 } // namespace Name2
34} // namespace Name1
35
36// Test multiple levels of metatype expansion
37int test_fcn () {
38 stage3_Foo MyFoo;
39
40 MyFoo.// -3-
41 // #3# ( "Mumble" "get" )
42 ;
43
44 Name1::Name2::F//-4-
45 // #4# ( "Foo" )
46 ;
47
48 // @TODO - get this working...
49 Name1::stage2_Foo::M//-5-
50 /// #5# ( "Mumble" )
51 ;
52}
53
54stage3_Foo foo_fcn() {
55 // Can we go "up" to foo with senator-go-to-up-reference?
56}
57
58
59// Second test from Ravikiran Rajagopal
60
61namespace A {
62 class foo {
63 public:
64 void aa();
65 void bb();
66 };
67}
68namespace A {
69 class bar {
70 public:
71 void xx();
72 public:
73 foo myFoo;
74 };
75
76 void bar::xx()
77 {
78 myFoo.// -6- <--- cursor is here after the dot
79 // #6# ( "aa" "bb" )
80 ;
81 }
82}
83
84// Double namespace example from Hannu Koivisto
85//
86// This is tricky because the parent class "Foo" is found within the
87// scope of B, so the scope calculation needs to put that together
88// before searching for parents in scope.
89namespace a {
90 namespace b {
91
92 class Bar : public Foo
93 {
94 int baz();
95 };
96
97 int Bar::baz()
98 {
99 return dum// -7-
100 // #7# ( "dumdum" )
101 ;
102 }
103
104 } // namespace b
105} // namespace a
106
107// Three namespace example from Hannu Koivisto
108//
109// This one is special in that the name e::Foo, where "e" is in
110// the scope, and not referenced from the global namespace. This
111// wasn't previously handled, so the fullscope needed to be added
112// to the list of things searched when in split-name decent search mode
113// for scopes.
114
115namespace d {
116 namespace e {
117
118 class Foo
119 {
120 public:
121 int write();
122 };
123
124 } // namespace d
125} // namespace e
126
127
128namespace d {
129 namespace f {
130
131 class Bar
132 {
133 public:
134 int baz();
135
136 private:
137 e::Foo &foo;
138 };
139
140 int Bar::baz()
141 {
142 return foo.w// -8-
143 // #8# ( "write" )
144 ;
145 }
146
147 } // namespace f
148} // namespace d