Skip to content

Commit

Permalink
Test: upate input_test.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
YuLiu98 committed Nov 10, 2023
1 parent 35bd3a7 commit 80360c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/module_io/test/input_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ TEST_F(InputTest, Read)
EXPECT_TRUE(INPUT.search_pbc);
EXPECT_EQ(INPUT.symmetry,"1");
EXPECT_FALSE(INPUT.init_vel);
EXPECT_DOUBLE_EQ(INPUT.symmetry_prec, 1.0e-6);
EXPECT_DOUBLE_EQ(INPUT.symmetry_prec, 1.0e-5);
EXPECT_FALSE(INPUT.symmetry_autoclose);
EXPECT_EQ(INPUT.cal_force, 0);
EXPECT_NEAR(INPUT.force_thr,1.0e-3,1.0e-7);
Expand Down Expand Up @@ -1025,13 +1025,14 @@ TEST_F(InputTest, Check)
EXPECT_EXIT(INPUT.Check(), ::testing::ExitedWithCode(0), "");
output = testing::internal::GetCapturedStdout();
EXPECT_THAT(output, testing::HasSubstr("ecutrho/ecutwfc must >= 4"));

INPUT.ecutrho = 100.0;
INPUT.nx = INPUT.ny = INPUT.nz = 10;
INPUT.ndx = INPUT.ndy = INPUT.ndz = 8;
testing::internal::CaptureStdout();
INPUT.Check();
EXPECT_EXIT(INPUT.Check(), ::testing::ExitedWithCode(0), "");
output = testing::internal::GetCapturedStdout();
EXPECT_THAT(output, testing::HasSubstr("smooth grids is denser than dense grids"));
INPUT.ndx = INPUT.ndy = INPUT.ndz = 11;
//
INPUT.nbands = -1;
testing::internal::CaptureStdout();
Expand Down

0 comments on commit 80360c6

Please sign in to comment.