comparison test/cedet/tests/testdoublens.cpp @ 105267:c99cf31de3f2

Add CEDET tests.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 28 Sep 2009 23:23:31 +0000
parents e480034314ce
children 7f4c7f5c0eba
comparison
equal deleted inserted replaced
105266:c02e98221afe 105267:c99cf31de3f2
1 //
2 // CPP file for semantic-ia-utest
3 // completion engine unit tests.
4 //
5 #include "testdoublens.hpp"
6
7 namespace 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
37 int 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
54 stage3_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
61 namespace A {
62 class foo {
63 public:
64 void aa();
65 void bb();
66 };
67 }
68 namespace 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.
89 namespace 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
115 namespace d {
116 namespace e {
117
118 class Foo
119 {
120 public:
121 int write();
122 };
123
124 } // namespace d
125 } // namespace e
126
127
128 namespace 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