Skip to content

Commit

Permalink
fix C++ transform unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Jan 21, 2025
1 parent 9f3dcc6 commit 207dd98
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions rerun_cpp/tests/archetypes/transform3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ SCENARIO(
const auto quaternion = rrd::Quaternion::from_xyzw(1.0f, 2.0f, 3.0f, 4.0f);
const auto axis_angle = rrd::RotationAxisAngle({1.0f, 2.0f, 3.0f}, rrd::Angle::degrees(90.0f));

// List out everything so that GCC doesn't get nervous around uninitialized values.
Transform3D manual;
manual.scale = std::nullopt;
manual.mat3x3 = std::nullopt;
manual.translation = std::nullopt;
manual.relation = std::nullopt;
manual.axis_length = std::nullopt;
Transform3D manual = Transform3D::clear_fields();

GIVEN("Transform3D from translation") {
auto utility = Transform3D::from_translation({1.0f, 2.0f, 3.0f});
Expand All @@ -52,8 +46,6 @@ SCENARIO(
}

GIVEN("Transform3D from 3x3 matrix") {
manual.translation = std::nullopt;

AND_GIVEN("matrix as initializer list") {
auto utility = Transform3D::from_mat3x3(MATRIX_ILIST);
manual.mat3x3 = ComponentBatch::from_loggable(
Expand Down Expand Up @@ -241,7 +233,8 @@ SCENARIO(
}

GIVEN("A custom relation") {
auto utility = Transform3D().with_relation(rrc::TransformRelation::ChildFromParent);
auto utility =
Transform3D::clear_fields().with_relation(rrc::TransformRelation::ChildFromParent);
manual.relation = ComponentBatch::from_loggable(
rrc::TransformRelation::ChildFromParent,
Transform3D::Descriptor_relation
Expand Down

0 comments on commit 207dd98

Please sign in to comment.