diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-06-15 18:22:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-15 18:22:46 +0200 |
commit | a40522d738daa540471f559667bd99597899850e (patch) | |
tree | f1bea9a1795181fd9d7e483f79ea422ccdeadde2 | |
parent | c2ba60f31a59ed5b4494ce424871c92bd2746644 (diff) | |
parent | 7c84aa11014227c245306379bcbb8280083dc65e (diff) |
Merge pull request #49619 from KoBeWi/virtual_police
Validate that all virtual methods start with _
-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 |