summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-06-29 17:16:19 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:06 -0300
commit007442264ec64071abceede296c47f3bbf162776 (patch)
treeae305067687b706d0421bdcb6df2af3752c46ef7
parentec74d012b6dc5eb49df4259dd64e33e455b8c5cc (diff)
Added test for class member inside a two nested namespaces.
-rw-r--r--tests/testnamespace.cpp29
-rw-r--r--tests/testnamespace.h1
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/testnamespace.cpp b/tests/testnamespace.cpp
index a860b35e..3833700a 100644
--- a/tests/testnamespace.cpp
+++ b/tests/testnamespace.cpp
@@ -51,6 +51,35 @@ void TestNamespace::testNamespaceMembers()
QVERIFY(func);
}
+void TestNamespace::testNamespaceInnerClassMembers()
+{
+ const char* cppCode = "\
+ namespace OuterNamespace\
+ {\
+ namespace InnerNamespace {\
+ struct SomeClass {\
+ void method();\
+ };\
+ };\
+ };";
+ const char* xmlCode = "\
+ <typesystem package='Foo'> \
+ <namespace-type name='OuterNamespace' />\
+ <namespace-type name='OuterNamespace::InnerNamespace' />\
+ <value-type name='OuterNamespace::InnerNamespace::SomeClass' /> \
+ </typesystem>";
+ TestUtil t(cppCode, xmlCode, false);
+ AbstractMetaClassList classes = t.builder()->classes();
+ AbstractMetaClass* ons = classes.findClass("OuterNamespace");
+ QVERIFY(ons);
+ AbstractMetaClass* ins = classes.findClass("OuterNamespace::InnerNamespace");
+ QVERIFY(ins);
+ AbstractMetaClass* sc = classes.findClass("OuterNamespace::InnerNamespace::SomeClass");
+ QVERIFY(sc);
+ const AbstractMetaFunction* meth = sc->findFunction("method");
+ QVERIFY(meth);
+}
+
QTEST_APPLESS_MAIN(TestNamespace)
#include "testnamespace.moc"
diff --git a/tests/testnamespace.h b/tests/testnamespace.h
index 69595d14..77f24eb9 100644
--- a/tests/testnamespace.h
+++ b/tests/testnamespace.h
@@ -31,6 +31,7 @@ class TestNamespace : public QObject
Q_OBJECT
private slots:
void testNamespaceMembers();
+ void testNamespaceInnerClassMembers();
};
#endif