From 4c734c1b26e9cbe24a2b9dd8a6f7960c068daccc Mon Sep 17 00:00:00 2001 From: Brian Manh Hien Han Date: Mon, 30 Sep 2024 11:12:44 -0700 Subject: [PATCH] Verify only one message in buffer --- src/axom/slic/tests/slic_macros_parallel.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/axom/slic/tests/slic_macros_parallel.cpp b/src/axom/slic/tests/slic_macros_parallel.cpp index bbf66d0429..b034dffe2e 100644 --- a/src/axom/slic/tests/slic_macros_parallel.cpp +++ b/src/axom/slic/tests/slic_macros_parallel.cpp @@ -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();