Skip to content

Commit 5ddc59d

Browse files
author
dyzheng
committed
Fix: error in UT
1 parent a88cb25 commit 5ddc59d

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

source/module_hsolver/test/hsolver_supplementary_mock.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ void ElecState::init_ks(Charge* chg_in, // pointer for class Charge
5757
return;
5858
}
5959

60+
Potential::~Potential(){}
61+
62+
void Potential::cal_v_eff(const Charge*const chg, const UnitCell*const ucell, ModuleBase::matrix& v_eff){}
63+
64+
void Potential::cal_fixed_v(double* vl_pseudo){}
65+
6066
} // namespace elecstate
6167

6268

source/module_hsolver/test/test_hsolver_pw.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class TestHSolverPW : public ::testing::Test {
8484
TEST_F(TestHSolverPW, solve) {
8585
// initial memory and data
8686
elecstate_test.ekb.create(1, 2);
87+
elecstate_test.pot = new elecstate::Potential;
8788
this->ekb_f.resize(2);
8889
psi_test_cf.resize(1, 2, 3);
8990
psi_test_cd.resize(1, 2, 3);
@@ -216,6 +217,7 @@ TEST_F(TestHSolverPW, SolveLcaoInPW) {
216217
pwbk.nks = 1;
217218
// initial memory and data
218219
elecstate_test.ekb.create(1, 2);
220+
elecstate_test.pot = new elecstate::Potential;
219221
// 1 kpt, 2 bands, 3 basis
220222
psi_test_cf.resize(1, 2, 3);
221223
psi_test_cd.resize(1, 2, 3);

source/module_hsolver/test/test_hsolver_sdft.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ TEST_F(TestHSolverPW_SDFT, solve)
170170
{
171171
//initial memory and data
172172
elecstate_test.ekb.create(1,2);
173+
elecstate_test.pot = new elecstate::Potential;
173174
elecstate_test.f_en.eband = 0.0;
174175
stowf.nbands_diag = 0;
175176
stowf.nbands_total = 0;
@@ -213,6 +214,7 @@ TEST_F(TestHSolverPW_SDFT, solve_noband_skipcharge)
213214
{
214215
//initial memory and data
215216
elecstate_test.ekb.create(1,2);
217+
elecstate_test.pot = new elecstate::Potential;
216218
elecstate_test.f_en.eband = 0.0;
217219
stowf.nbands_diag = 0;
218220
stowf.nbands_total = 0;

0 commit comments

Comments
 (0)