Merge pull request #1591 from dsnopek/variant-object-instance-id

Directly get object instance ID from `Variant` and implement `Variant::get_validated_object()`
This commit is contained in:
David Snopek
2024-10-29 13:10:12 -05:00
committed by GitHub
8 changed files with 34 additions and 6 deletions

View File

@@ -209,6 +209,12 @@ func _ready():
assert_equal(example.test_variant_float_conversion(10.0), 10.0)
assert_equal(example.test_variant_float_conversion(10), 10.0)
# Test checking if objects are valid.
var object_of_questionable_validity = Object.new()
assert_equal(example.test_object_is_valid(object_of_questionable_validity), true)
object_of_questionable_validity.free()
assert_equal(example.test_object_is_valid(object_of_questionable_validity), false)
# Test that ptrcalls from GDExtension to the engine are correctly encoding Object and RefCounted.
var new_node = Node.new()
example.test_add_child(new_node)