-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* improve test coverage * test if passes on GHactions * didn't work on GHActions * aded tests for SkeletonDebug class * fix code climate issues
- Loading branch information
1 parent
d4fa74a
commit 8915809
Showing
9 changed files
with
90 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#include <gtest/gtest.h> | ||
#include "Manager.h" | ||
#include "mainwindow.h" | ||
#include "SkeletonDebug.h" | ||
|
||
class SkeletonDebugTests : public ::testing::Test { | ||
protected: | ||
std::unique_ptr<SkeletonDebug> skeletonDebug; | ||
|
||
void SetUp() override { | ||
QStringList validUri{"./media/models/robot.mesh"}; | ||
Manager::getSingleton()->getMainWindow()->importMeshs(validUri); | ||
Ogre::Entity* entity = Manager::getSingleton()->getEntities().last(); | ||
Ogre::SceneManager* sceneManager = Manager::getSingleton()->getSceneMgr(); | ||
skeletonDebug = std::make_unique<SkeletonDebug>(entity,sceneManager); | ||
} | ||
|
||
}; | ||
|
||
TEST_F(SkeletonDebugTests, ShowAxesTest) | ||
{ | ||
// Initially, axes should not be shown | ||
EXPECT_FALSE(skeletonDebug->axesShown()); | ||
|
||
// Show axes | ||
skeletonDebug->showAxes(true); | ||
EXPECT_TRUE(skeletonDebug->axesShown()); | ||
|
||
// Hide axes | ||
skeletonDebug->showAxes(false); | ||
EXPECT_FALSE(skeletonDebug->axesShown()); | ||
} | ||
|
||
TEST_F(SkeletonDebugTests, ShowNamesTest) | ||
{ | ||
// Initially, names should not be shown | ||
EXPECT_FALSE(skeletonDebug->namesShown()); | ||
|
||
// Show names | ||
skeletonDebug->showNames(true); | ||
EXPECT_TRUE(skeletonDebug->namesShown()); | ||
|
||
// Hide names | ||
skeletonDebug->showNames(false); | ||
EXPECT_FALSE(skeletonDebug->namesShown()); | ||
} | ||
|
||
TEST_F(SkeletonDebugTests, ShowBonesTest) | ||
{ | ||
// Initially, bones should not be shown | ||
EXPECT_FALSE(skeletonDebug->bonesShown()); | ||
|
||
// Show bones | ||
skeletonDebug->showBones(true); | ||
EXPECT_TRUE(skeletonDebug->bonesShown()); | ||
|
||
// Hide bones | ||
skeletonDebug->showBones(false); | ||
EXPECT_FALSE(skeletonDebug->bonesShown()); | ||
} | ||
|
||
TEST_F(SkeletonDebugTests, SetAndGetAxesScaleTest) | ||
{ | ||
// Set axes scale | ||
skeletonDebug->setAxesScale(0.5f); | ||
EXPECT_FLOAT_EQ(skeletonDebug->getAxesScale(), 0.5f); | ||
|
||
// Set axes scale to a different value | ||
skeletonDebug->setAxesScale(1.0f); | ||
EXPECT_FLOAT_EQ(skeletonDebug->getAxesScale(), 1.0f); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters