Call onRecycle after element is marked as deallocated in IndexedMemPool
[folly.git] / folly / test / IndexedMemPoolTest.cpp
index a5faa43ada334c3c3fc215d4958c0078f7307675..c15566b29def444d48a43c1c4fe8c4da41762f12 100644 (file)
@@ -357,7 +357,7 @@ void testTraits(TraitsTestPool& pool) {
 
   elem = nullptr;
   EXPECT_CALL(traits, onRecycle(_)).WillOnce(Invoke([&](std::string* s) {
-    EXPECT_TRUE(pool.isAllocated(pool.locateElem(s)));
+    EXPECT_FALSE(pool.isAllocated(pool.locateElem(s)));
     elem = s;
   }));
   pool.recycleIndex(pool.locateElem(ptr));