Skip to content

Commit

Permalink
Restore aysncappender check that every message is delivered
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-webb committed Jul 23, 2024
1 parent 478b5fb commit 4565ac0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/cpp/asyncappendertestcase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,22 @@ class AsyncAppenderTestCase : public AppenderSkeletonTestCase
const std::vector<spi::LoggingEventPtr>& v = vectorAppender->getVector();
LOGUNIT_ASSERT_EQUAL(LEN*threadCount, (int)v.size());
std::map<LogString, int> perThreadCount;
std::vector<int> msgCount(LEN, 0);
for (auto m : v)
{
auto i = StringHelper::toInt(m->getMessage().substr(7));
LOGUNIT_ASSERT(0 <= i);
LOGUNIT_ASSERT(i < LEN);
++msgCount[i];
++perThreadCount[m->getThreadName()];
}
LOGUNIT_ASSERT_EQUAL(threadCount, (int)perThreadCount.size());
for (auto& item : perThreadCount)
{
LOGUNIT_ASSERT_EQUAL(item.second, LEN);
}
for (size_t i = 0; i < LEN; i++)
LOGUNIT_ASSERT_EQUAL(msgCount[i], threadCount);
}

/**
Expand Down

0 comments on commit 4565ac0

Please sign in to comment.