aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-10-29 20:02:53 -0200
committerHugo Lima <hugo.lima@openbossa.org>2009-10-29 20:02:53 -0200
commit5ccbce7a917a2a602ad1fa32d8682afe32dd68bc (patch)
tree942b5597debf365a140c072816cb2726782937b6 /tests
parent64f7ae3334171168ff803f339d55a179a6e06001 (diff)
Fix a crash when the function signature provided by add-function tag does not
have parenteses. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/testaddfunction.cpp8
-rw-r--r--tests/testaddfunction.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/testaddfunction.cpp b/tests/testaddfunction.cpp
index 0637eb5c9..d02fc67e1 100644
--- a/tests/testaddfunction.cpp
+++ b/tests/testaddfunction.cpp
@@ -144,6 +144,14 @@ void TestAddFunction::testAddFunctionCodeSnippets()
QVERIFY(addedFunc->hasInjectedCode());
}
+void TestAddFunction::testFunctionWithoutParenteses()
+{
+ const char sig1[] = "func";
+ AddedFunction f1(sig1, "void");
+ QCOMPARE(f1.name(), QString("func"));
+ QCOMPARE(f1.arguments().count(), 0);
+ QCOMPARE(f1.isConstant(), false);
+}
QTEST_APPLESS_MAIN(TestAddFunction)
diff --git a/tests/testaddfunction.h b/tests/testaddfunction.h
index 45a562d4b..a8082a4b5 100644
--- a/tests/testaddfunction.h
+++ b/tests/testaddfunction.h
@@ -33,6 +33,7 @@ private slots:
void testAddFunction();
void testAddFunctionTagDefaultValues();
void testAddFunctionCodeSnippets();
+ void testFunctionWithoutParenteses();
};
#endif \ No newline at end of file