mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-01 05:48:37 +03:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user