Skip to content

Commit

Permalink
chore: remove unnecessary equals operator, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwa Shah authored and Vishwa Shah committed Feb 17, 2024
1 parent 590ff26 commit e9f5a6f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
4 changes: 0 additions & 4 deletions include/OpenSpaceToolkit/Physics/Data/Direction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ class Direction : public Vector
public:
Direction(const Vector3d& aValue, const Shared<const Frame>& aFrameSPtr);

bool operator==(const Direction& aDirection) const;

bool operator!=(const Direction& aDirection) const;

friend std::ostream& operator<<(std::ostream& anOutputStream, const Vector& aVector);

static Direction Undefined();
Expand Down
15 changes: 0 additions & 15 deletions src/OpenSpaceToolkit/Physics/Data/Direction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ Direction::Direction(const Vector3d& aValue, const Shared<const Frame>& aFrameSP
}
}

bool Direction::operator==(const Direction& aDirection) const
{
if ((!this->isDefined()) || (!aDirection.isDefined()))
{
return false;
}

return Vector::operator==(aDirection);
}

bool Direction::operator!=(const Direction& aDirection) const
{
return !((*this) == aDirection);
}

std::ostream& operator<<(std::ostream& anOutputStream, const Direction& aDirection)
{
ostk::core::utils::Print::Header(anOutputStream, "Direction");
Expand Down
16 changes: 1 addition & 15 deletions test/OpenSpaceToolkit/Physics/Data/Direction.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,14 @@ using ostk::physics::coordinate::Frame;
class OpenSpaceToolkit_Physics_Data_Direction : public ::testing::Test
{
protected:
const Vector3d value_ = {1.0, 2.0, 3.0};
const Vector3d value_ = {1.0, 0.0, 0.0};
const Shared<const Frame> frameSPtr_ = Frame::GCRF();
const Direction direction_ = {
value_,
frameSPtr_,
};
};

TEST_F(OpenSpaceToolkit_Physics_Data_Direction, EqualToOperator)
{
{
EXPECT_TRUE(direction_ == direction_);
}
}

TEST_F(OpenSpaceToolkit_Physics_Data_Direction, NotEqualToOperator)
{
{
EXPECT_FALSE(direction_ != direction_);
}
}

TEST_F(OpenSpaceToolkit_Physics_Data_Direction, StreamOperator)
{
{
Expand Down

0 comments on commit e9f5a6f

Please sign in to comment.