Skip to content

Commit d645610

Browse files
committed
fix some tests
1 parent 8788944 commit d645610

File tree

3 files changed

+1
-43
lines changed

3 files changed

+1
-43
lines changed

source/module_elecstate/test/elecstate_print_test.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -112,49 +112,8 @@ TEST_F(ElecStatePrintTest, PrintFormat)
112112
std::remove("test.dat");
113113
}
114114

115-
TEST_F(ElecStatePrintTest, PrintBand)
116-
{
117-
PARAM.input.nspin = 1;
118-
PARAM.input.nbands = 2;
119-
PARAM.sys.nbands_l = 2;
120-
GlobalV::MY_RANK = 0;
121-
122-
std::ofstream ofs;
123-
ofs.open("test.dat", std::ios::out);
124-
// print eigenvalues
125-
elecstate::print_band(elecstate.ekb,elecstate.wg,elecstate.klist, 0, 1, 0, ofs);
126-
ofs.close();
127-
128-
ifs.open("test.dat", std::ios::in);
129-
std::string str((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
130-
EXPECT_THAT(str, testing::HasSubstr("Energy (eV) & Occupations for spin=1 k-point=1"));
131-
EXPECT_THAT(str, testing::HasSubstr("1 13.6057 0.100000"));
132-
EXPECT_THAT(str, testing::HasSubstr("2 27.2114 0.200000"));
133-
ifs.close();
134-
std::remove("test.dat");
135-
}
136115

137116

138-
TEST_F(ElecStatePrintTest, PrintBandWarning)
139-
{
140-
elecstate.ekb(0, 0) = 1.0e11;
141-
PARAM.input.nspin = 4;
142-
143-
std::ofstream ofs;
144-
ofs.open("test.dat", std::ios::out);
145-
testing::internal::CaptureStdout();
146-
147-
EXPECT_EXIT(elecstate::print_band(elecstate.ekb,elecstate.wg,elecstate.klist, 0, 1, 0, ofs),
148-
::testing::ExitedWithCode(1), "");
149-
150-
output = testing::internal::GetCapturedStdout();
151-
EXPECT_THAT(output, testing::HasSubstr("Eigenvalues are too large!"));
152-
153-
ofs.close();
154-
155-
std::remove("test.dat");
156-
}
157-
158117
TEST_F(ElecStatePrintTest, PrintEtot)
159118
{
160119
GlobalV::ofs_running.open("test.dat", std::ios::out);

source/module_io/test/read_input_ptest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ TEST_F(InputParaTest, ParaRead)
180180
EXPECT_DOUBLE_EQ(param.inp.mixing_gg0, 0.00);
181181
EXPECT_EQ(param.inp.init_wfc, "atomic");
182182
EXPECT_EQ(param.inp.mem_saver, 0);
183-
EXPECT_EQ(param.inp.printe, 100);
184183
EXPECT_EQ(param.inp.init_chg, "atomic");
185184
EXPECT_EQ(param.inp.chg_extrap, "atomic");
186185
EXPECT_EQ(param.inp.out_freq_elec, 50);

source/module_io/test/write_eig_occ_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ TEST_F(IstateInfoTest, OutIstateInfoS1)
9898
}
9999

100100
// write eigenvalues and occupations
101-
ModuleIO::write_eig_occ(ekb, wg, *kv);
101+
ModuleIO::write_eig_file(ekb, wg, *kv);
102102

103103
// check the output files
104104
std::ifstream ifs;

0 commit comments

Comments
 (0)