Skip to content

Commit

Permalink
Verify only one message in buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
bmhan12 committed Sep 30, 2024
1 parent 8dbf34a commit 4c734c1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/axom/slic/tests/slic_macros_parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ void check_msg(const std::string& msg, const std::string& expected_message)
{
EXPECT_FALSE(msg.empty());

// message is output only once (combining successful for LumberjackStream)
int count = 0;
size_t pos = 0;

while((pos = msg.find(expected_message, pos)) != std::string::npos)
{
count++;
pos += expected_message.length();
}

EXPECT_EQ(count, 1);

// extract message
size_t start = msg.find(";;") + 2;
size_t end = expected_message.length();
Expand Down

0 comments on commit 4c734c1

Please sign in to comment.