retrieving the error message clears the error status

This commit is contained in:
Axel Kohlmeyer 2022-10-04 09:16:15 -04:00
parent 90e820e8ec
commit b0e3c2a440
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 6 additions and 0 deletions

View File

@ -134,5 +134,11 @@ TEST_F(LAMMPS_properties, has_error)
int err = f_lammps_get_last_error_message(errmsg, 1023);
EXPECT_EQ(err, 1);
EXPECT_THAT(errmsg, ContainsRegex(".*ERROR: Unknown command: this_is_not_a_known_command.*"));
// retrieving the error message clear the error status
EXPECT_EQ(f_lammps_has_error(), 0);
err = f_lammps_get_last_error_message(errmsg, 1023);
EXPECT_EQ(err, 0);
EXPECT_THAT(errmsg, ContainsRegex(" "));
};
} // namespace LAMMPS_NS