fix up kim unit tests broken by recent changes

This commit is contained in:
Axel Kohlmeyer
2022-12-09 19:56:45 -05:00
parent 34f44daef5
commit 07bb7b3195
2 changed files with 8 additions and 8 deletions

View File

@ -283,7 +283,7 @@ void KimParam::command(int narg, char **arg)
// Get the variable/variable_base name // Get the variable/variable_base name
varname = std::string(arg[i++]); varname = std::string(arg[i++]);
if ((varname == "split") || (varname == "list") || (varname == "explicit")) if ((varname == "split") || (varname == "list") || (varname == "explicit"))
error->all(FLERR, "Illegal variable name {} in 'kim param get'", varname); error->all(FLERR, "Illegal variable name '{}' in 'kim param get'", varname);
} else } else
error->all(FLERR, "Wrong number of arguments in 'kim param get' command.\n" error->all(FLERR, "Wrong number of arguments in 'kim param get' command.\n"
"The LAMMPS variable name is mandatory"); "The LAMMPS variable name is mandatory");
@ -312,7 +312,7 @@ void KimParam::command(int narg, char **arg)
for (int j = 0; j < nvars; ++j, ++i) { for (int j = 0; j < nvars; ++j, ++i) {
varsname[j] = std::string(arg[i]); varsname[j] = std::string(arg[i]);
if (varsname[j] == "split" || varsname[j] == "list" || varsname[j] == "explicit") if (varsname[j] == "split" || varsname[j] == "list" || varsname[j] == "explicit")
error->all(FLERR, "Illegal variable name {} in 'kim param get'", varsname[j]); error->all(FLERR, "Illegal variable name '{}' in 'kim param get'", varsname[j]);
} }
if (i < narg) { if (i < narg) {
formatarg = std::string(arg[i]); formatarg = std::string(arg[i]);

View File

@ -307,17 +307,17 @@ TEST_F(KimCommandsTest, kim_param)
ASSERT_THAT(variable->retrieve("shift"), StrEq("2")); ASSERT_THAT(variable->retrieve("shift"), StrEq("2"));
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", TEST_FAILURE(".*ERROR: Illegal variable name 'list' in 'kim param get'.*",
command("kim param get cutoffs 1:3 list");); command("kim param get cutoffs 1:3 list"););
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", TEST_FAILURE(".*ERROR: Illegal variable name 'list' in 'kim param get'.*",
command("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 list");); command("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 list"););
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", TEST_FAILURE(".*ERROR: Illegal variable name 'split' in 'kim param get'.*",
command("kim param get cutoffs 1:3 split");); command("kim param get cutoffs 1:3 split"););
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", TEST_FAILURE(".*ERROR: Illegal variable name 'split' in 'kim param get'.*",
command("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 split");); command("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 split"););
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", TEST_FAILURE(".*ERROR: Illegal variable name 'explicit' in 'kim param get'.*",
command("kim param get cutoffs 1:3 explicit");); command("kim param get cutoffs 1:3 explicit"););
TEST_FAILURE(".*ERROR: Illegal variable name in 'kim param get'.*", TEST_FAILURE(".*ERROR: Illegal variable name 'explicit' in 'kim param get'.*",
command("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 explicit");); command("kim param get cutoffs 1:3 cutoffs_1 cutoffs_2 explicit"););
TEST_FAILURE(".*ERROR: Wrong number of arguments in 'kim param get' " TEST_FAILURE(".*ERROR: Wrong number of arguments in 'kim param get' "
"command.\nThe LAMMPS '3' variable names or 'cutoffs " "command.\nThe LAMMPS '3' variable names or 'cutoffs "