diff --git a/src/OpenSpaceToolkit/Astrodynamics/Trajectory/StateBuilder.cpp b/src/OpenSpaceToolkit/Astrodynamics/Trajectory/StateBuilder.cpp index 52015c155..68c418fd5 100644 --- a/src/OpenSpaceToolkit/Astrodynamics/Trajectory/StateBuilder.cpp +++ b/src/OpenSpaceToolkit/Astrodynamics/Trajectory/StateBuilder.cpp @@ -39,20 +39,9 @@ bool StateBuilder::operator==(const StateBuilder& aStateBuilder) const return false; } - for (const Shared& subset : this->coordinatesBrokerSPtr_->accessSubsets()) + if ((*this->coordinatesBrokerSPtr_) != (*aStateBuilder.coordinatesBrokerSPtr_)) { - if (!aStateBuilder.coordinatesBrokerSPtr_->hasSubset(subset)) - { - return false; - } - } - - for (const Shared& subset : aStateBuilder.coordinatesBrokerSPtr_->accessSubsets()) - { - if (!this->coordinatesBrokerSPtr_->hasSubset(subset)) - { - return false; - } + return false; } return true; diff --git a/test/OpenSpaceToolkit/Astrodynamics/Trajectory/StateBuilder.test.cpp b/test/OpenSpaceToolkit/Astrodynamics/Trajectory/StateBuilder.test.cpp index 68f01353c..71ff97234 100644 --- a/test/OpenSpaceToolkit/Astrodynamics/Trajectory/StateBuilder.test.cpp +++ b/test/OpenSpaceToolkit/Astrodynamics/Trajectory/StateBuilder.test.cpp @@ -82,7 +82,6 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Trajectory_StateBuilder, EqualToOperator) const StateBuilder anotherStateBuilder = {Frame::GCRF(), posVelMassBrokerSPtr}; EXPECT_FALSE(aStateBuilder == anotherStateBuilder); - EXPECT_FALSE(anotherStateBuilder == aStateBuilder); } { @@ -106,7 +105,7 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Trajectory_StateBuilder, EqualToOperator) const StateBuilder anotherStateBuilder = {Frame::GCRF(), velPosBrokerSPtr}; - EXPECT_TRUE(aStateBuilder == anotherStateBuilder); + EXPECT_FALSE(aStateBuilder == anotherStateBuilder); } { @@ -183,7 +182,7 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Trajectory_StateBuilder, NotEqualToOperato const StateBuilder anotherStateBuilder = {Frame::GCRF(), velPosBrokerSPtr}; - EXPECT_FALSE(aStateBuilder != anotherStateBuilder); + EXPECT_TRUE(aStateBuilder != anotherStateBuilder); } {