Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Variant assignment to Vec2 tests #83959

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions tests/core/variant/test_variant.h
Original file line number Diff line number Diff line change
@@ -980,45 +980,45 @@ TEST_CASE("[Variant] Assignment To Vec2 from Bool,Int,Float,String,Vec2i,Vec3,Ve
CHECK(basis_v.get_type() == Variant::VECTOR2);

Variant aabb_v = AABB();
string_v = "Hello";
aabb_v = string_v;
CHECK(aabb_v == Variant("Hello"));
string_v = "Hello there";
aabb_v = string_v;
CHECK(aabb_v.get_type() == Variant::STRING);
vec2_v = Vector2(2.2f, 3.5f);
aabb_v = vec2_v;
CHECK(aabb_v == Variant(Vector2(2.2f, 3.5f)));
vec2_v = Vector2(-5.4f, -7.9f);
aabb_v = vec2_v;
CHECK(aabb_v.get_type() == Variant::VECTOR2);

Variant quaternion_v = Quaternion();
string_v = "Hello";
quaternion_v = string_v;
CHECK(quaternion_v == Variant("Hello"));
string_v = "Hello there";
quaternion_v = string_v;
CHECK(quaternion_v.get_type() == Variant::STRING);
vec2_v = Vector2(2.2f, 3.5f);
quaternion_v = vec2_v;
CHECK(quaternion_v == Variant(Vector2(2.2f, 3.5f)));
vec2_v = Vector2(-5.4f, -7.9f);
quaternion_v = vec2_v;
CHECK(quaternion_v.get_type() == Variant::VECTOR2);

Variant projection_v = Projection();
string_v = "Hello";
projection_v = string_v;
CHECK(projection_v == Variant("Hello"));
string_v = "Hello there";
projection_v = string_v;
CHECK(projection_v.get_type() == Variant::STRING);
vec2_v = Vector2(2.2f, 3.5f);
projection_v = vec2_v;
CHECK(projection_v == Variant(Vector2(2.2f, 3.5f)));
vec2_v = Vector2(-5.4f, -7.9f);
projection_v = vec2_v;
CHECK(projection_v.get_type() == Variant::VECTOR2);

Variant rid_v = RID();
string_v = "Hello";
rid_v = string_v;
CHECK(rid_v == Variant("Hello"));
string_v = "Hello there";
rid_v = string_v;
CHECK(rid_v.get_type() == Variant::STRING);
vec2_v = Vector2(2.2f, 3.5f);
rid_v = vec2_v;
CHECK(rid_v == Variant(Vector2(2.2f, 3.5f)));
vec2_v = Vector2(-5.4f, -7.9f);
rid_v = vec2_v;
CHECK(rid_v.get_type() == Variant::VECTOR2);

Object obj_one = Object();
Variant object_v = &obj_one;
string_v = "Hello";
object_v = string_v;
CHECK(object_v == Variant("Hello"));
string_v = "Hello there";
object_v = string_v;
CHECK(object_v.get_type() == Variant::STRING);
vec2_v = Vector2(2.2f, 3.5f);
object_v = vec2_v;
CHECK(object_v == Variant(Vector2(2.2f, 3.5f)));
vec2_v = Vector2(-5.4f, -7.9f);
object_v = vec2_v;
CHECK(object_v.get_type() == Variant::VECTOR2);
}

TEST_CASE("[Variant] Assignment To Vec2i from Bool,Int,Float,String,Vec2,Vec3,Vec3i,Vec4,Vec4i,Rect2,Rect2i,Trans2d,Trans3d,Color,Call,Plane,Basis,AABB,Quant,Proj,RID,and Object") {