From ab3db91c92193656f5d2afa91ba99c02c860b5be Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Sat, 13 Jan 2024 19:56:48 -0500 Subject: [PATCH] Add pure virtual test --- test/src/example.h | 18 ++++++++++++++++++ test/src/register_types.cpp | 3 +++ 2 files changed, 21 insertions(+) diff --git a/test/src/example.h b/test/src/example.h index 72f6783d..32d66d56 100644 --- a/test/src/example.h +++ b/test/src/example.h @@ -205,4 +205,22 @@ protected: static void _bind_methods() {} }; +class ExamplePureVirtualBase : public Object { + GDCLASS(ExamplePureVirtualBase, Object); + +protected: + static void _bind_methods() {} + + virtual int test_function() = 0; +}; + +class ExamplePureVirtual : public ExamplePureVirtualBase { + GDCLASS(ExamplePureVirtual, ExamplePureVirtualBase); + +protected: + static void _bind_methods() {} + + int test_function() override { return 25; } +}; + #endif // EXAMPLE_CLASS_H diff --git a/test/src/register_types.cpp b/test/src/register_types.cpp index dbb37d90..5b99d385 100644 --- a/test/src/register_types.cpp +++ b/test/src/register_types.cpp @@ -26,6 +26,9 @@ void initialize_example_module(ModuleInitializationLevel p_level) { ClassDB::register_class(); ClassDB::register_class(true); ClassDB::register_abstract_class(); + + GDREGISTER_VIRTUAL_CLASS(ExamplePureVirtualBase); + GDREGISTER_CLASS(ExamplePureVirtual); } void uninitialize_example_module(ModuleInitializationLevel p_level) {