Remove multiple definitions of STRINGIFY

This commit is contained in:
Richard Berger
2020-05-19 23:15:22 -04:00
parent c04a71a239
commit c0acb3a438
4 changed files with 26 additions and 56 deletions

View File

@ -99,20 +99,14 @@ LAMMPS_NS::LAMMPS *init_lammps(int argc, char **argv,
lmp->input->one("variable newton_bond index off");
}
#define STRINGIFY(val) XSTR(val)
#define XSTR(val) #val
std::string set_input_dir = "variable input_dir index ";
set_input_dir += STRINGIFY(TEST_INPUT_FOLDER);
set_input_dir += INPUT_FOLDER;
lmp->input->one(set_input_dir.c_str());
for (auto pre_command : cfg.pre_commands)
lmp->input->one(pre_command.c_str());
std::string input_file = STRINGIFY(TEST_INPUT_FOLDER);
input_file += "/";
input_file += cfg.input_file;
std::string input_file = INPUT_FOLDER + PATH_SEP + cfg.input_file;
lmp->input->file(input_file.c_str());
#undef STRINGIFY
#undef XSTR
std::string cmd("angle_style ");
cmd += cfg.angle_style;
@ -186,14 +180,8 @@ void data_lammps(LAMMPS_NS::LAMMPS *lmp, const TestConfig &cfg)
cmd += cfg.basename + ".data";
lmp->input->one(cmd.c_str());
#define STRINGIFY(val) XSTR(val)
#define XSTR(val) #val
std::string input_file = STRINGIFY(TEST_INPUT_FOLDER);
input_file += "/";
input_file += cfg.input_file;
std::string input_file = INPUT_FOLDER + PATH_SEP + cfg.input_file;
lmp->input->file(input_file.c_str());
#undef STRINGIFY
#undef XSTR
for (auto angle_coeff : cfg.angle_coeff) {
cmd = "angle_coeff " + angle_coeff;