Add smoke test with Tween to check for issues with handling RefCounted

This commit is contained in:
David Snopek
2025-10-28 11:37:00 -05:00
parent 6c05f1f0b1
commit 618ee44a23
4 changed files with 12 additions and 0 deletions

View File

@@ -222,6 +222,7 @@ void Example::_bind_methods() {
ClassDB::bind_method(D_METHOD("test_add_child", "node"), &Example::test_add_child);
ClassDB::bind_method(D_METHOD("test_set_tileset", "tilemap", "tileset"), &Example::test_set_tileset);
ClassDB::bind_method(D_METHOD("test_tween_smoke_test"), &Example::test_tween_smoke_test);
ClassDB::bind_method(D_METHOD("test_variant_call", "variant"), &Example::test_variant_call);
@@ -616,6 +617,11 @@ void Example::test_set_tileset(TileMap *p_tilemap, const Ref<TileSet> &p_tileset
p_tilemap->set_tileset(p_tileset);
}
bool Example::test_tween_smoke_test() {
Ref<Tween> tween = create_tween();
return tween.is_valid() && tween->is_class("Tween") && tween->get_reference_count() > 1;
}
Variant Example::test_variant_call(Variant p_variant) {
return p_variant.call("test", "hello");
}