diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GenerateSipBindings/cpplib.cpp | 7 | ||||
-rw-r--r-- | tests/GenerateSipBindings/cpplib.h | 16 | ||||
-rw-r--r-- | tests/GenerateSipBindings/rules_SipTest.py | 7 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/GenerateSipBindings/cpplib.cpp b/tests/GenerateSipBindings/cpplib.cpp index 7eb15939..f996c998 100644 --- a/tests/GenerateSipBindings/cpplib.cpp +++ b/tests/GenerateSipBindings/cpplib.cpp @@ -161,3 +161,10 @@ int anotherCustomMethod(QList<int> const& nums) { return 0; } + +void TypedefUser::setTagPattern(const QString &tagName, + SomeNS::TagFormatter formatter, + int leadingNewlines) +{ + +} diff --git a/tests/GenerateSipBindings/cpplib.h b/tests/GenerateSipBindings/cpplib.h index b69480ee..34167ad3 100644 --- a/tests/GenerateSipBindings/cpplib.h +++ b/tests/GenerateSipBindings/cpplib.h @@ -128,8 +128,24 @@ qreal useEnum(MyFlags flags = EnumValueOne); int customMethod(QList<int> const& nums); +typedef QString(*TagFormatter)(const QStringList &languages, + const QString &tagName, + const QHash<QString, QString> &attributes, + const QString &text, + const QStringList &tagPath, + SomeNS::MyFlagType format); + } +class TypedefUser +{ +public: + + void setTagPattern(const QString &tagName, + SomeNS::TagFormatter formatter = NULL, + int leadingNewlines = 0); +}; + int anotherCustomMethod(QList<int> const& nums); enum __attribute__((visibility("default"))) EnumWithAttributes { diff --git a/tests/GenerateSipBindings/rules_SipTest.py b/tests/GenerateSipBindings/rules_SipTest.py index 1331da41..73c5451b 100644 --- a/tests/GenerateSipBindings/rules_SipTest.py +++ b/tests/GenerateSipBindings/rules_SipTest.py @@ -9,6 +9,12 @@ def local_function_rules(): return [ ["MyObject", "fwdDecl", ".*", ".*", ".*", rules_engine.function_discard], ["MyObject", "fwdDeclRef", ".*", ".*", ".*", rules_engine.function_discard], + ["TypedefUser", "setTagPattern", ".*", ".*", ".*", rules_engine.function_discard], + ] + +def local_typedef_rules(): + return [ + [".*", "TagFormatter", rules_engine.typedef_discard], ] def methodGenerator(function, sip, entry): @@ -23,6 +29,7 @@ class RuleSet(Qt5Ruleset.RuleSet): def __init__(self): Qt5Ruleset.RuleSet.__init__(self) self._fn_db = rules_engine.FunctionRuleDb(lambda: local_function_rules() + Qt5Ruleset.function_rules()) + self._typedef_db = rules_engine.TypedefRuleDb(lambda: local_typedef_rules() + Qt5Ruleset.typedef_rules()) self._modulecode = rules_engine.ModuleCodeDb({ "cpplib.h": { "code": """ |