Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SPH tests #56

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading