diff --git a/tests/src/ObjectPoolTests.cpp b/tests/src/ObjectPoolTests.cpp index 265d741f3..b821a92d2 100644 --- a/tests/src/ObjectPoolTests.cpp +++ b/tests/src/ObjectPoolTests.cpp @@ -76,7 +76,13 @@ void testRandomSequenceOfCmds(MockObjectPool& opl, int numEvents, bool setCap) { // The percent active is calculated out of the pool's total capacity // which must be gte our max observed active count - CHECK(opl.computePercentActive() <= (float)numActive / (float)maxActiveCount); + float expectedPercentActive; + if (maxActiveCount != 0) { + expectedPercentActive = (float)numActive / (float)maxActiveCount; + } else { + expectedPercentActive = 0; + } + CHECK(opl.computePercentActive() <= expectedPercentActive); } // ---- Begin tests ----