aboutsummaryrefslogtreecommitdiffstats
path: root/tests/testaddfunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testaddfunction.cpp')
-rw-r--r--tests/testaddfunction.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/testaddfunction.cpp b/tests/testaddfunction.cpp
index 4e03c962..2d4ee91f 100644
--- a/tests/testaddfunction.cpp
+++ b/tests/testaddfunction.cpp
@@ -407,6 +407,23 @@ void TestAddFunction::testAddFunctionOnTypedef()
QVERIFY(method);
}
+void TestAddFunction::testAddFunctionWithTemplateArg()
+{
+ const char cppCode[] = "template<class T> class Foo { };";
+ const char xmlCode[] = "\
+ <typesystem package='Package'>\
+ <primitive-type name='int'/>\
+ <container-type name='Foo' type='list'/>\
+ <add-function signature='func(Foo&lt;int>)' />\
+ </typesystem>";
+
+ TestUtil t(cppCode, xmlCode);
+ QCOMPARE(t.builder()->globalFunctions().size(), 1);
+ AbstractMetaFunction* func = t.builder()->globalFunctions().first();
+ AbstractMetaArgument* arg = func->arguments().first();
+ QCOMPARE(arg->type()->instantiations().count(), 1);
+}
+
QTEST_APPLESS_MAIN(TestAddFunction)
#include "testaddfunction.moc"