diff options
author | kobewi <kobewi4e@gmail.com> | 2021-06-14 10:43:51 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2021-06-15 17:47:30 +0200 |
commit | 7c84aa11014227c245306379bcbb8280083dc65e (patch) | |
tree | f1bea9a1795181fd9d7e483f79ea422ccdeadde2 /tests | |
parent | c2ba60f31a59ed5b4494ce424871c92bd2746644 (diff) |
Validate that all virtual methods start with _
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_class_db.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_class_db.h b/tests/test_class_db.h index fe2ed696c5..75785fa5ed 100644 --- a/tests/test_class_db.h +++ b/tests/test_class_db.h @@ -665,7 +665,7 @@ void add_exposed_classes(Context &r_context) { TEST_COND(exposed_class.find_property_by_name(method.name), "Method name conflicts with property: '", String(class_name), ".", String(method.name), "'."); - // Classes starting with an underscore are ignored unless they're used as a property setter or getter + // Methods starting with an underscore are ignored unless they're virtual or used as a property setter or getter. if (!method.is_virtual && String(method.name)[0] == '_') { for (const List<PropertyData>::Element *F = exposed_class.properties.front(); F; F = F->next()) { const PropertyData &prop = F->get(); @@ -678,6 +678,10 @@ void add_exposed_classes(Context &r_context) { } else { exposed_class.methods.push_back(method); } + + if (method.is_virtual) { + TEST_COND(String(method.name)[0] != '_', "Virtual method ", String(method.name), " does not start with underscore."); + } } // Add signals |