Skip to content

Commit

Permalink
fix tests in md
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanchen committed May 13, 2024
1 parent 2c11db3 commit 4267571
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions source/module_esolver/test/esolver_dp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ESolverDPTest : public ::testing::Test
{
// Initialize variables before each test
esolver = new ModuleESolver::ESolver_DP("./support/case_1.pb");
esolver->init(inp, ucell);
esolver->before_all_runners(inp, ucell);
}

void TearDown() override
Expand Down Expand Up @@ -85,7 +85,7 @@ TEST_F(ESolverDPTest, InitCase2)
esolver->dp_type[0] = 0;
esolver->dp_type[1] = 0;
esolver->dp_file = "./support/case_2.pb";
esolver->init(inp, ucell);
esolver->before_all_runners(inp, ucell);

// Check the initialized variables
EXPECT_EQ(esolver->dp_type[0], 0);
Expand All @@ -100,7 +100,7 @@ TEST_F(ESolverDPTest, RunWarningQuit)
int istep = 0;

testing::internal::CaptureStdout();
EXPECT_EXIT(esolver->run(istep, ucell), ::testing::ExitedWithCode(0), "");
EXPECT_EXIT(esolver->runner(istep, ucell), ::testing::ExitedWithCode(0), "");
std::string output = testing::internal::GetCapturedStdout();
EXPECT_THAT(output, testing::HasSubstr("Please recompile with -D__DPMD"));
}
Expand Down Expand Up @@ -171,7 +171,7 @@ TEST_F(ESolverDPTest, Postprocess)

// Check the results
GlobalV::ofs_running.open("log");
esolver->post_process();
esolver->after_all_runners();
GlobalV::ofs_running.close();

std::string expected_output = "\n\n --------------------------------------------\n !FINAL_ETOT_IS 133.3358404 eV\n "
Expand Down
2 changes: 1 addition & 1 deletion source/module_md/test/fire_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class FIREtest : public testing::Test
Setcell::parameters();

ModuleESolver::ESolver* p_esolver = new ModuleESolver::ESolver_LJ();
p_esolver->init(INPUT, ucell);
p_esolver->before_all_runners(INPUT, ucell);

mdrun = new FIRE(INPUT.mdp, ucell);
mdrun->setup(p_esolver, GlobalV::global_readin_dir);
Expand Down
2 changes: 1 addition & 1 deletion source/module_md/test/langevin_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Langevin_test : public testing::Test
Setcell::parameters();

ModuleESolver::ESolver* p_esolver = new ModuleESolver::ESolver_LJ();
p_esolver->init(INPUT, ucell);
p_esolver->before_all_runners(INPUT, ucell);

mdrun = new Langevin(INPUT.mdp, ucell);
mdrun->setup(p_esolver, GlobalV::global_readin_dir);
Expand Down
2 changes: 1 addition & 1 deletion source/module_md/test/lj_pot_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LJ_pot_test : public testing::Test
Setcell::parameters();

ModuleESolver::ESolver* p_esolver = new ModuleESolver::ESolver_LJ();
p_esolver->init(INPUT, ucell);
p_esolver->before_all_runners(INPUT, ucell);
MD_func::force_virial(p_esolver, 0, ucell, potential, force, true, stress);
}

Expand Down
2 changes: 1 addition & 1 deletion source/module_md/test/msst_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MSST_test : public testing::Test
Setcell::parameters();

ModuleESolver::ESolver* p_esolver = new ModuleESolver::ESolver_LJ();
p_esolver->init(INPUT, ucell);
p_esolver->before_all_runners(INPUT, ucell);

mdrun = new MSST(INPUT.mdp, ucell);
mdrun->setup(p_esolver, GlobalV::global_readin_dir);
Expand Down
2 changes: 1 addition & 1 deletion source/module_md/test/nhchain_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class NHC_test : public testing::Test
Setcell::parameters();

ModuleESolver::ESolver* p_esolver = new ModuleESolver::ESolver_LJ();
p_esolver->init(INPUT, ucell);
p_esolver->before_all_runners(INPUT, ucell);

INPUT.mdp.md_type = "npt";
INPUT.mdp.md_pmode = "tri";
Expand Down
2 changes: 1 addition & 1 deletion source/module_md/test/verlet_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Verlet_test : public testing::Test
Setcell::parameters();

ModuleESolver::ESolver* p_esolver = new ModuleESolver::ESolver_LJ();
p_esolver->init(INPUT, ucell);
p_esolver->before_all_runners(INPUT, ucell);

mdrun = new Verlet(INPUT.mdp, ucell);
mdrun->setup(p_esolver, GlobalV::global_readin_dir);
Expand Down

0 comments on commit 4267571

Please sign in to comment.