diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2009-12-28 16:38:22 -0200 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-07 16:03:40 -0200 |
commit | 8dded56b403fd979f0b567666017dc12f7c1a9b6 (patch) | |
tree | 4fd6f0a769132021fed7cdfbaaad6702b9c04db9 /tests/testaddfunction.cpp | |
parent | 11679b1008b9443ee817e382731ea9049eb2fe64 (diff) |
Added function can be tagged as static methods.
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/testaddfunction.cpp')
-rw-r--r-- | tests/testaddfunction.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/testaddfunction.cpp b/tests/testaddfunction.cpp index 4d98de18b..e3472c390 100644 --- a/tests/testaddfunction.cpp +++ b/tests/testaddfunction.cpp @@ -289,6 +289,28 @@ void TestAddFunction::testAddFunctionWithVarargs() QVERIFY(arg->type()->typeEntry()->isVarargs()); } +void TestAddFunction::testAddStaticFunction() +{ + const char cppCode[] = "struct A { };"; + const char xmlCode[] = "\ + <typesystem package=\"Foo\">\ + <primitive-type name='int'/> \ + <value-type name='A'>\ + <add-function signature='func(int, int)' static='yes'>\ + <inject-code class='target' position='beginning'>custom_code();</inject-code>\ + </add-function>\ + </value-type>\ + </typesystem>"; + TestUtil t(cppCode, xmlCode, false); + AbstractMetaClassList classes = t.builder()->classes(); + AbstractMetaClass* classA = classes.findClass("A"); + QVERIFY(classA); + qDebug() << classes[0]->name(); + const AbstractMetaFunction* addedFunc = classA->findFunction("func"); + QVERIFY(addedFunc); + QVERIFY(addedFunc->isStatic()); +} + QTEST_APPLESS_MAIN(TestAddFunction) #include "testaddfunction.moc" |