Skip to content

Commit

Permalink
Add SPH tests (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
aartiukh authored Jan 25, 2025
1 parent 4c1ad92 commit 028f327
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sph/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ set(SPH_TESTS_BIN_NAME sph_tests)
file(GLOB SPH_TEST_SRC_LIST_INCLUDE "src/ParticleTestSuite.h"
"src/ForcesTestSuite.h"
"src/CollisionsTestSuite.h"
"src/IntegratorTestSuite.h")
"src/IntegratorTestSuite.h"
"src/SPHTestSuite.h")
file(GLOB SPH_TEST_SRC_LIST_SOURCE "src/MainTest.cpp"
"src/ParticleTestSuite.cpp"
"src/ForcesTestSuite.cpp"
"src/CollisionsTestSuite.cpp"
"src/IntegratorTestSuite.cpp")
"src/IntegratorTestSuite.cpp"
"src/SPHTestSuite.cpp")

include_directories(SYSTEM ${GTEST_INCLUDE_DIRECTORY})

Expand Down
35 changes: 35 additions & 0 deletions sph/test/src/SPHTestSuite.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* @file SPHTestSuite.cpp
* @author Anton Artiukh
* @date Created Jan 25, 2025
**/

#include "SPHTestSuite.h"

#include "SPH.h"

#include <gtest/gtest.h>

namespace SPHSDK
{
namespace TestEnvironment
{

void SPHTestSuite::runSPH()
{
SPHSDK::SPH sph;

sph.run();

EXPECT_EQ(Config::ParticlesNumber, sph.particles.size());
}

} // namespace TestEnvironment
} // namespace SPHSDK

using namespace SPHSDK::TestEnvironment;

TEST(SPHTestSuite, runSPH)
{
SPHTestSuite::runSPH();
}
25 changes: 25 additions & 0 deletions sph/test/src/SPHTestSuite.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @file SPHTestSuite.h
* @author Anton Artiukh
* @date Created Jan 25, 2025
**/

#ifndef SPH_TEST_SUITE_H_26192C2023784EE0B4976A48A1A8772B
#define SPH_TEST_SUITE_H_26192C2023784EE0B4976A48A1A8772B

namespace SPHSDK
{

namespace TestEnvironment
{

class SPHTestSuite
{
public:
static void runSPH();
};

} // namespace TestEnvironment
} // namespace SPHSDK

#endif // SPH_TEST_SUITE_H_26192C2023784EE0B4976A48A1A8772B

0 comments on commit 028f327

Please sign in to comment.