From 9961a25273bd6ff59efdef4d482269eea8c069d0 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Thu, 8 Jul 2010 17:05:21 -0300 Subject: Fix bug#260 - "Can't modify argument name of a function added with add-function tag." --- tests/testaddfunction.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests/testaddfunction.cpp') diff --git a/tests/testaddfunction.cpp b/tests/testaddfunction.cpp index e2be5a153..0346a6367 100644 --- a/tests/testaddfunction.cpp +++ b/tests/testaddfunction.cpp @@ -352,6 +352,33 @@ void TestAddFunction::testAddFunctionWithApiVersion() QCOMPARE(globalFuncs.count(), 1); } +void TestAddFunction::testModifyAddedFunction() +{ + const char cppCode[] = "class Foo { };"; + const char xmlCode[] = "\ + \ + \ + \ + \ + \ + custom_code();\ + \ + \ + \ + \ + \ + \ + "; + TestUtil t(cppCode, xmlCode); + AbstractMetaClassList classes = t.builder()->classes(); + AbstractMetaClass* foo = classes.findClass("Foo"); + const AbstractMetaFunction* method = foo->findFunction("method"); + QCOMPARE(method->arguments().size(), 2); + AbstractMetaArgument* arg = method->arguments().at(1); + QCOMPARE(arg->defaultValueExpression(), QString("0")); + QCOMPARE(arg->name(), QString("varName")); + QCOMPARE(method->argumentName(2), QString("varName")); +} QTEST_APPLESS_MAIN(TestAddFunction) -- cgit v1.2.3