Download tests/src/Base/Axis.cpp from AbdulElahGwaith/FreeCAD: direct link, hf CLI and curl.
- Browser
- Download file 2.34 kB
-
https://huggingface.co/AbdulElahGwaith/FreeCAD/resolve/main/tests/src/Base/Axis.cpp
- Command line
-
hf download hf://AbdulElahGwaith/FreeCAD/tests/src/Base/Axis.cpp
-
curl -L -o Axis.cpp https://huggingface.co/AbdulElahGwaith/FreeCAD/resolve/main/tests/src/Base/Axis.cpp
2.34 kB
| class Axis: public ::testing::Test | |
| { | |
| protected: | |
| static void SetUpTestSuite() | |
| { | |
| tests::initApplication(); | |
| } | |
| }; | |
| TEST_F(Axis, TestDefault) | |
| { | |
| Base::Axis axis; | |
| EXPECT_EQ(axis.getBase(), Base::Vector3d()); | |
| EXPECT_EQ(axis.getDirection(), Base::Vector3d()); | |
| } | |
| TEST_F(Axis, TestCustom) | |
| { | |
| Base::Axis axis(Base::Vector3d(0, 0, 1), Base::Vector3d(1, 1, 1)); | |
| EXPECT_EQ(axis.getBase(), Base::Vector3d(0, 0, 1)); | |
| EXPECT_EQ(axis.getDirection(), Base::Vector3d(1, 1, 1)); | |
| } | |
| TEST_F(Axis, TestSetter) | |
| { | |
| Base::Axis axis; | |
| axis.setBase(Base::Vector3d(0, 0, 1)); | |
| axis.setDirection(Base::Vector3d(1, 1, 1)); | |
| EXPECT_EQ(axis.getBase(), Base::Vector3d(0, 0, 1)); | |
| EXPECT_EQ(axis.getDirection(), Base::Vector3d(1, 1, 1)); | |
| } | |
| TEST_F(Axis, TestAssign) | |
| { | |
| Base::Axis axis; | |
| Base::Axis move; | |
| axis.setBase(Base::Vector3d(0, 0, 1)); | |
| axis.setDirection(Base::Vector3d(1, 1, 1)); | |
| move = std::move(axis); // NOLINT | |
| EXPECT_EQ(move.getBase(), Base::Vector3d(0, 0, 1)); | |
| EXPECT_EQ(move.getDirection(), Base::Vector3d(1, 1, 1)); | |
| } | |
| TEST_F(Axis, TestReverse) | |
| { | |
| Base::Axis axis(Base::Vector3d(0, 0, 1), Base::Vector3d(1, 1, 1)); | |
| axis.reverse(); | |
| EXPECT_EQ(axis.getBase(), Base::Vector3d(0, 0, 1)); | |
| EXPECT_EQ(axis.getDirection(), Base::Vector3d(-1, -1, -1)); | |
| } | |
| TEST_F(Axis, TestReversed) | |
| { | |
| Base::Axis axis(Base::Vector3d(0, 0, 1), Base::Vector3d(1, 1, 1)); | |
| Base::Axis rev(axis.reversed()); | |
| EXPECT_EQ(axis.getDirection(), Base::Vector3d(1, 1, 1)); | |
| EXPECT_EQ(rev.getBase(), Base::Vector3d(0, 0, 1)); | |
| EXPECT_EQ(rev.getDirection(), Base::Vector3d(-1, -1, -1)); | |
| } | |
| TEST_F(Axis, TestMove) | |
| { | |
| Base::Axis axis(Base::Vector3d(0, 0, 1), Base::Vector3d(1, 1, 1)); | |
| axis.move(Base::Vector3d(1, 2, 3)); | |
| EXPECT_EQ(axis.getBase(), Base::Vector3d(1, 2, 4)); | |
| EXPECT_EQ(axis.getDirection(), Base::Vector3d(1, 1, 1)); | |
| } | |
| TEST_F(Axis, TestMult) | |
| { | |
| Base::Axis axis(Base::Vector3d(0, 0, 1), Base::Vector3d(0, 0, 1)); | |
| axis *= Base::Placement(Base::Vector3d(1, 1, 1), Base::Rotation(1, 0, 0, 0)); | |
| EXPECT_EQ(axis.getBase(), Base::Vector3d(1, 1, 0)); | |
| EXPECT_EQ(axis.getDirection(), Base::Vector3d(0, 0, -1)); | |
| } | |