Skip to content

Commit

Permalink
add input test
Browse files Browse the repository at this point in the history
  • Loading branch information
maki49 committed Jul 14, 2024
1 parent 097c3c9 commit 9ebcfc5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/module_io/test/read_input_ptest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,16 @@ TEST_F(InputParaTest, ParaRead)
EXPECT_DOUBLE_EQ(param.inp.alpha_trial, 0.02);
EXPECT_DOUBLE_EQ(param.inp.sccut, 4.0);
EXPECT_EQ(param.inp.sc_file, "sc.json");
EXPECT_EQ(param.inp.lr_nstates, 1);
EXPECT_EQ(param.inp.nocc, param.inp.nbands);
EXPECT_EQ(param.inp.nvirt, 1);
EXPECT_EQ(param.inp.xc_kernel, "LDA");
EXPECT_EQ(param.inp.lr_solver, "dav");
EXPECT_DOUBLE_EQ(param.inp.lr_thr, 1e-2);
EXPECT_FALSE(param.inp.out_wfc_lr);
EXPECT_EQ(param.inp.abs_wavelen_range.size(), 2);
EXPECT_DOUBLE_EQ(param.inp.abs_wavelen_range[0], 0.0);
EXPECT_DOUBLE_EQ(param.inp.abs_broadening, 0.01);
}

TEST_F(InputParaTest, Check)
Expand Down
11 changes: 11 additions & 0 deletions source/module_io/test_serial/read_input_item_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1637,4 +1637,15 @@ TEST_F(InputTest, Item_test)
output = testing::internal::GetCapturedStdout();
EXPECT_THAT(output, testing::HasSubstr("NOTICE"));
}
{ // nocc
auto it = find_lable("nocc", readinput.input_lists);
param.input.nocc = 5;
param.input.nbands = 4;
param.input.nelec = 0.0;
it->second.reset_value(it->second, param);
EXPECT_EQ(param.input.nocc, 4);
param.input.nocc = 0;
it->second.reset_value(it->second, param);
EXPECT_EQ(param.input.nocc, 4);
}
}

0 comments on commit 9ebcfc5

Please sign in to comment.