diff test/cedet/tests/testfriends.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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/cedet/tests/testfriends.cpp	Mon Sep 28 23:23:31 2009 +0000
@@ -0,0 +1,37 @@
+// Test parsing of friends and how they are used in completion.
+/*
+  >>  Thanks Damien Profeta for the nice example.
+  >
+  >  I paste a small example.
+  >  It would be great if friend can be well parsed and even greater if
+  >  class B can access to all the members of A.
+*/
+
+class Af // %2% ( ( "testfriends.cpp" ) ( "Af" "B::testB" ) )
+{
+public:
+  int pubVar;
+private:
+  int privateVar;
+
+  friend class B;
+
+};
+
+class B
+{
+public:
+  int testB();
+  int testAB();
+
+};
+
+
+int B::testB() {
+  Af classA;
+  classA.//-1-
+    ; //#1# ( "privateVar" "pubVar" )
+}
+
+int B::testAB() { // %1% ( ( "testfriends.cpp" ) ( "B" "B::testAB" ) )
+}