Skip to content
Snippets Groups Projects
Commit 5baed6ed authored by Anna Wellmann's avatar Anna Wellmann
Browse files

Remove test as it does not really test Parameter

parent 851f65de
No related branches found
No related tags found
1 merge request!234Update CMakeList for VF_GPU and remove a unit test for Parameter.cpp
......@@ -250,64 +250,6 @@ TEST(ParameterTest, whenCreatingParameterClassWithGridRefinement_afterCallingIni
EXPECT_THAT(para->getParH(1), testing::Ne(nullptr));
}
class MockCommunicator : public vf::gpu::Communicator
{
public:
void waitAll() override {};
int getPID() const override
{
return 0;
};
int getNumberOfProcess() const override
{
return 1;
};
void exchngData(float *sbuf_t, float *rbuf_t, float *sbuf_b, float *rbuf_b, int count) override {};
//////////////////////////////////////////////////////////////////////////
void exchngDataGPU(real *sbuf, int count_s, real *rbuf, int count_r, int nb_rank) override {};
void nbRecvDataGPU(real *rbuf, int count_r, int nb_rank) override {};
void nbSendDataGPU(real *sbuf, int count_s, int nb_rank) override {};
void waitallGPU() override {};
void sendDataGPU(real *sbuf, int count_s, int nb_rank) override {};
void waitGPU(int id) override {};
void resetRequest() override {};
//////////////////////////////////////////////////////////////////////////
int mapCudaDevice(const int &rank, const int &size, const std::vector<unsigned int> &devices, const int &maxdev) override
{
return 0;
};
double reduceSum(double quantityPerProcess) override
{
return 0;
};
//////////////////////////////////////////////////////////////////////////
void receive_send(uint *buffer_receive, int size_buffer_recv, int neighbor_rank_recv, uint *buffer_send, int size_buffer_send, int neighbor_rank_send) const override {};
};
TEST(ParameterTest, whenCreatingParameterClassWithGridRefinement_afterCallingSimulationConstructor_shouldNotThrow)
{
spdlog::set_level(spdlog::level::warn); // avoids logger spam in output
auto para = std::make_shared<Parameter>();
para->setMaxLevel(2);
SPtr<CudaMemoryManager> cudaMemoryManager = std::make_shared<CudaMemoryManager>(para);
MockCommunicator communicator = MockCommunicator();
auto gridFactory = GridFactory::make();
auto gridBuilder = MultipleGridBuilder::makeShared(gridFactory);
SPtr<GridProvider> gridGenerator =
std::make_shared<MockGridGenerator>(gridBuilder, para, cudaMemoryManager, communicator);
BoundaryConditionFactory bcFactory = BoundaryConditionFactory();
GridScalingFactory scalingFactory = GridScalingFactory();
EXPECT_THAT(para->getParH(1), testing::Eq(nullptr)); // Parameter initialization incomplete
// Simulation() calls para->initLBMSimulationParameter() --> that function completes the initialization of Parameter
Simulation sim(para, cudaMemoryManager, communicator, *gridGenerator, &bcFactory, &scalingFactory);
EXPECT_THAT(para->getParH(1), testing::Ne(nullptr));
EXPECT_NO_THROW(cudaMemoryManager->cudaAllocLevelForcing(1)); // throws if para->getParH(1) is a null pointer
}
class ParameterTestCumulantK17 : public testing::Test
{
protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment