plug memory leaks in testers

This commit is contained in:
Axel Kohlmeyer
2024-08-20 09:19:58 -04:00
parent 2b485a3f62
commit 19d6227220
4 changed files with 16 additions and 6 deletions

View File

@ -85,10 +85,19 @@ TEST_F(LAMMPS_thermo, last_thermo)
f_lammps_last_thermo_setup();
EXPECT_EQ(f_lammps_last_thermo_step(), 15);
EXPECT_EQ(f_lammps_last_thermo_num(), 6);
EXPECT_STREQ(f_lammps_last_thermo_string(1), "Step");
EXPECT_STREQ(f_lammps_last_thermo_string(2), "Temp");
EXPECT_STREQ(f_lammps_last_thermo_string(3), "E_pair");
EXPECT_STREQ(f_lammps_last_thermo_string(6), "Press");
char *thermostr;
thermostr = (char *)f_lammps_last_thermo_string(1);
EXPECT_STREQ(thermostr, "Step");
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)
EXPECT_EQ(f_lammps_last_thermo_type(1), multitype::LAMMPS_INT);
#else