Skip to content

Commit d8e518a

Browse files
committed
fix bug in the unittest
1 parent 9f7dc74 commit d8e518a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,4 @@ time.json
2222
*.pyc
2323
__pycache__
2424
abacus.json
25-
*.npy
26-
*.sh
27-
*.py
28-
*.txt
25+
*.npy

source/module_cell/test/unitcell_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ TEST_F(UcellTest, PrintSTRU)
928928
*
929929
*/
930930
unitcell::print_stru_file(*ucell,ucell->atoms,ucell->latvec,
931-
fn, 1, false, false, false, false, false, 0);
931+
fn, 2, true, true, false, false, false, 0);
932932
ifs.open("C1H2_STRU");
933933
str = {(std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>()};
934934
EXPECT_THAT(str, testing::HasSubstr("ATOMIC_SPECIES"));
@@ -970,7 +970,7 @@ TEST_F(UcellTest, PrintSTRU)
970970
ucell->atom_mulliken
971971
= {{-1, 0.5}, {-1, 0.4}, {-1, 0.3}}; // first index is iat, the second is components, starts seems from 1
972972
unitcell::print_stru_file(*ucell,ucell->atoms,ucell->latvec,
973-
fn, 1, false, false, false, false, false, 0);
973+
fn, 2, true, false, true, true, true, 0);
974974
ifs.open("C1H2_STRU");
975975
str = {(std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>()};
976976
EXPECT_THAT(str, testing::HasSubstr("ATOMIC_SPECIES"));

source/module_relax/relax_new/test/relax_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,13 @@ class Test_RELAX : public testing::Test
270270
for(int i=0;i<ntype;i++)
271271
{
272272
int na = ucell.atoms[i].na;
273+
ucell.atoms[i].label="test";
273274
ucell.atoms[i].mbl.resize(na);
274275
ucell.atoms[i].taud.resize(na);
275276
ucell.atoms[i].tau.resize(na);
276277
ucell.atoms[i].dis.resize(na);
278+
ucell.atoms[i].mag.resize(na);
279+
ucell.atoms[i].vel.resize(na);
277280
for (int j=0;j<na;j++)
278281
{
279282
ucell.atoms[i].mbl[j] = {1,1,1};

0 commit comments

Comments
 (0)