Skip to content

Commit

Permalink
Fix: error in UT
Browse files Browse the repository at this point in the history
  • Loading branch information
dyzheng committed Oct 12, 2024
1 parent a88cb25 commit 5ddc59d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/module_hsolver/test/hsolver_supplementary_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ void ElecState::init_ks(Charge* chg_in, // pointer for class Charge
return;
}

Potential::~Potential(){}

void Potential::cal_v_eff(const Charge*const chg, const UnitCell*const ucell, ModuleBase::matrix& v_eff){}

void Potential::cal_fixed_v(double* vl_pseudo){}

} // namespace elecstate


Expand Down
2 changes: 2 additions & 0 deletions source/module_hsolver/test/test_hsolver_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class TestHSolverPW : public ::testing::Test {
TEST_F(TestHSolverPW, solve) {
// initial memory and data
elecstate_test.ekb.create(1, 2);
elecstate_test.pot = new elecstate::Potential;
this->ekb_f.resize(2);
psi_test_cf.resize(1, 2, 3);
psi_test_cd.resize(1, 2, 3);
Expand Down Expand Up @@ -216,6 +217,7 @@ TEST_F(TestHSolverPW, SolveLcaoInPW) {
pwbk.nks = 1;
// initial memory and data
elecstate_test.ekb.create(1, 2);
elecstate_test.pot = new elecstate::Potential;
// 1 kpt, 2 bands, 3 basis
psi_test_cf.resize(1, 2, 3);
psi_test_cd.resize(1, 2, 3);
Expand Down
2 changes: 2 additions & 0 deletions source/module_hsolver/test/test_hsolver_sdft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ TEST_F(TestHSolverPW_SDFT, solve)
{
//initial memory and data
elecstate_test.ekb.create(1,2);
elecstate_test.pot = new elecstate::Potential;
elecstate_test.f_en.eband = 0.0;
stowf.nbands_diag = 0;
stowf.nbands_total = 0;
Expand Down Expand Up @@ -213,6 +214,7 @@ TEST_F(TestHSolverPW_SDFT, solve_noband_skipcharge)
{
//initial memory and data
elecstate_test.ekb.create(1,2);
elecstate_test.pot = new elecstate::Potential;
elecstate_test.f_en.eband = 0.0;
stowf.nbands_diag = 0;
stowf.nbands_total = 0;
Expand Down

0 comments on commit 5ddc59d

Please sign in to comment.