Use platform::path_join in unittest tree and remove redundant code
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include "lammps.h"
|
||||
#include "library.h"
|
||||
#include "lmptype.h"
|
||||
#include "platform.h"
|
||||
#include <string>
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
@ -13,6 +14,7 @@
|
||||
#define STRINGIFY(val) XSTR(val)
|
||||
#define XSTR(val) #val
|
||||
|
||||
using ::LAMMPS_NS::platform::path_join;
|
||||
using ::LAMMPS_NS::tagint;
|
||||
using ::testing::HasSubstr;
|
||||
using ::testing::StartsWith;
|
||||
@ -82,7 +84,7 @@ TEST_F(LibraryProperties, get_mpi_comm)
|
||||
TEST_F(LibraryProperties, natoms)
|
||||
{
|
||||
if (!lammps_has_style(lmp, "atom", "full")) GTEST_SKIP();
|
||||
std::string input = INPUT_DIR + PATH_SEP + "in.fourmol";
|
||||
std::string input = path_join(INPUT_DIR, "in.fourmol");
|
||||
if (!verbose) ::testing::internal::CaptureStdout();
|
||||
lammps_file(lmp, input.c_str());
|
||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||
@ -92,7 +94,7 @@ TEST_F(LibraryProperties, natoms)
|
||||
TEST_F(LibraryProperties, thermo)
|
||||
{
|
||||
if (!lammps_has_style(lmp, "atom", "full")) GTEST_SKIP();
|
||||
std::string input = INPUT_DIR + PATH_SEP + "in.fourmol";
|
||||
std::string input = path_join(INPUT_DIR, "in.fourmol");
|
||||
::testing::internal::CaptureStdout();
|
||||
lammps_file(lmp, input.c_str());
|
||||
lammps_command(lmp, "run 2 post no");
|
||||
@ -108,7 +110,7 @@ TEST_F(LibraryProperties, thermo)
|
||||
TEST_F(LibraryProperties, box)
|
||||
{
|
||||
if (!lammps_has_style(lmp, "atom", "full")) GTEST_SKIP();
|
||||
std::string input = INPUT_DIR + PATH_SEP + "in.fourmol";
|
||||
std::string input = path_join(INPUT_DIR, "in.fourmol");
|
||||
::testing::internal::CaptureStdout();
|
||||
lammps_file(lmp, input.c_str());
|
||||
lammps_command(lmp, "run 2 post no");
|
||||
@ -248,7 +250,7 @@ TEST_F(LibraryProperties, setting)
|
||||
EXPECT_EQ(lammps_extract_setting(lmp, "UNKNOWN"), -1);
|
||||
|
||||
if (lammps_has_style(lmp, "atom", "full")) {
|
||||
std::string input = INPUT_DIR + PATH_SEP + "in.fourmol";
|
||||
std::string input = path_join(INPUT_DIR, "in.fourmol");
|
||||
if (!verbose) ::testing::internal::CaptureStdout();
|
||||
lammps_file(lmp, input.c_str());
|
||||
lammps_command(lmp, "run 2 post no");
|
||||
@ -289,7 +291,7 @@ TEST_F(LibraryProperties, global)
|
||||
{
|
||||
if (!lammps_has_style(lmp, "atom", "full")) GTEST_SKIP();
|
||||
|
||||
std::string input = INPUT_DIR + PATH_SEP + "in.fourmol";
|
||||
std::string input = path_join(INPUT_DIR, "in.fourmol");
|
||||
if (!verbose) ::testing::internal::CaptureStdout();
|
||||
lammps_file(lmp, input.c_str());
|
||||
lammps_command(lmp, "run 2 post no");
|
||||
|
||||
Reference in New Issue
Block a user