update unit tests for missing error->message()
This commit is contained in:
@ -260,27 +260,25 @@ TEST_F(FileOperationsTest, logmesg)
|
||||
remove("test_logmesg.log");
|
||||
}
|
||||
|
||||
TEST_F(FileOperationsTest, error_message_warn)
|
||||
TEST_F(FileOperationsTest, error_warn)
|
||||
{
|
||||
char buf[64];
|
||||
BEGIN_HIDE_OUTPUT();
|
||||
command("echo none");
|
||||
command("log test_error_warn.log");
|
||||
command("log test_warn.log");
|
||||
END_HIDE_OUTPUT();
|
||||
BEGIN_CAPTURE_OUTPUT();
|
||||
lmp->error->message("testme.cpp", 10, "message me");
|
||||
lmp->error->warning("testme.cpp", 100, "warn me");
|
||||
command("log none");
|
||||
std::string out = END_CAPTURE_OUTPUT();
|
||||
memset(buf, 0, 64);
|
||||
FILE *fp = fopen("test_error_warn.log", "r");
|
||||
FILE *fp = fopen("test_warn.log", "r");
|
||||
fread(buf, 1, 64, fp);
|
||||
fclose(fp);
|
||||
auto msg = StrEq("message me (testme.cpp:10)\n"
|
||||
"WARNING: warn me (testme.cpp:100)\n");
|
||||
auto msg = StrEq("WARNING: warn me (testme.cpp:100)\n");
|
||||
ASSERT_THAT(out, msg);
|
||||
ASSERT_THAT(buf, msg);
|
||||
remove("test_error_warn.log");
|
||||
remove("test_warn.log");
|
||||
}
|
||||
|
||||
TEST_F(FileOperationsTest, error_all_one)
|
||||
|
||||
Reference in New Issue
Block a user