aboutsummaryrefslogtreecommitdiffstats
path: root/test/cedet/tests/testfriends.cpp
diff options
context:
space:
mode:
authorChong Yidong2009-09-20 04:00:13 +0000
committerChong Yidong2009-09-20 04:00:13 +0000
commit17af2991b5bd71ed2d3d69fd4467e1fc8a31d8d1 (patch)
tree8ff33ff92ead70e1a3aeead0d1334b4aedac027b /test/cedet/tests/testfriends.cpp
parent00999a2ef0648870573dcb3a3866c6401db8bc28 (diff)
downloademacs-17af2991b5bd71ed2d3d69fd4467e1fc8a31d8d1.tar.gz
emacs-17af2991b5bd71ed2d3d69fd4467e1fc8a31d8d1.zip
Add Semantic unit tests.
Diffstat (limited to 'test/cedet/tests/testfriends.cpp')
-rw-r--r--test/cedet/tests/testfriends.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/cedet/tests/testfriends.cpp b/test/cedet/tests/testfriends.cpp
new file mode 100644
index 00000000000..f84ed5a2190
--- /dev/null
+++ b/test/cedet/tests/testfriends.cpp
@@ -0,0 +1,37 @@
1// Test parsing of friends and how they are used in completion.
2/*
3 >> Thanks Damien Profeta for the nice example.
4 >
5 > I paste a small example.
6 > It would be great if friend can be well parsed and even greater if
7 > class B can access to all the members of A.
8*/
9
10class Af // %2% ( ( "testfriends.cpp" ) ( "Af" "B::testB" ) )
11{
12public:
13 int pubVar;
14private:
15 int privateVar;
16
17 friend class B;
18
19};
20
21class B
22{
23public:
24 int testB();
25 int testAB();
26
27};
28
29
30int B::testB() {
31 Af classA;
32 classA.//-1-
33 ; //#1# ( "privateVar" "pubVar" )
34}
35
36int B::testAB() { // %1% ( ( "testfriends.cpp" ) ( "B" "B::testAB" ) )
37}