plug memory leaks in testers
This commit is contained in:
@ -35,7 +35,7 @@ using namespace MathSpecial;
|
|||||||
|
|
||||||
PairMorseSoft::~PairMorseSoft()
|
PairMorseSoft::~PairMorseSoft()
|
||||||
{
|
{
|
||||||
if (allocated) { memory->destroy(lambda); }
|
if (allocated) memory->destroy(lambda);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -256,4 +256,5 @@ TEST(lammps_open_no_mpi, lammps_error)
|
|||||||
lammps_error(handle, 0, "test_warning");
|
lammps_error(handle, 0, "test_warning");
|
||||||
output = ::testing::internal::GetCapturedStdout();
|
output = ::testing::internal::GetCapturedStdout();
|
||||||
EXPECT_THAT(output, HasSubstr("WARNING: test_warning"));
|
EXPECT_THAT(output, HasSubstr("WARNING: test_warning"));
|
||||||
|
lammps_close(handle);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,10 +85,19 @@ TEST_F(LAMMPS_thermo, last_thermo)
|
|||||||
f_lammps_last_thermo_setup();
|
f_lammps_last_thermo_setup();
|
||||||
EXPECT_EQ(f_lammps_last_thermo_step(), 15);
|
EXPECT_EQ(f_lammps_last_thermo_step(), 15);
|
||||||
EXPECT_EQ(f_lammps_last_thermo_num(), 6);
|
EXPECT_EQ(f_lammps_last_thermo_num(), 6);
|
||||||
EXPECT_STREQ(f_lammps_last_thermo_string(1), "Step");
|
char *thermostr;
|
||||||
EXPECT_STREQ(f_lammps_last_thermo_string(2), "Temp");
|
thermostr = (char *)f_lammps_last_thermo_string(1);
|
||||||
EXPECT_STREQ(f_lammps_last_thermo_string(3), "E_pair");
|
EXPECT_STREQ(thermostr, "Step");
|
||||||
EXPECT_STREQ(f_lammps_last_thermo_string(6), "Press");
|
free(thermostr);
|
||||||
|
thermostr = (char *)f_lammps_last_thermo_string(2);
|
||||||
|
EXPECT_STREQ(thermostr, "Temp");
|
||||||
|
free(thermostr);
|
||||||
|
thermostr = (char *)f_lammps_last_thermo_string(3);
|
||||||
|
EXPECT_STREQ(thermostr, "E_pair");
|
||||||
|
free(thermostr);
|
||||||
|
thermostr = (char *)f_lammps_last_thermo_string(6);
|
||||||
|
EXPECT_STREQ(thermostr, "Press");
|
||||||
|
free(thermostr);
|
||||||
#if defined(LAMMPS_SMALLSMALL)
|
#if defined(LAMMPS_SMALLSMALL)
|
||||||
EXPECT_EQ(f_lammps_last_thermo_type(1), multitype::LAMMPS_INT);
|
EXPECT_EQ(f_lammps_last_thermo_type(1), multitype::LAMMPS_INT);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user