35 #include <gtest/gtest.h> 49 EXPECT_EQ(*item, 5UL);
55 EXPECT_EQ(*item, 6UL);
60 const uint32_t count = 5;
63 std::vector<boost::shared_ptr<uint32_t> > items;
66 for (uint32_t i = 0; i < count; ++i)
69 ASSERT_TRUE(items[i]);
70 EXPECT_EQ(*items[i], 5UL);
77 ASSERT_TRUE(items.back());
80 std::set<boost::shared_ptr<uint32_t> >
set;
81 set.insert(items.begin(), items.end());
82 EXPECT_EQ(
set.size(), count);
85 int main(
int argc,
char** argv)
87 testing::InitGoogleTest(&argc, argv);
88 return RUN_ALL_TESTS();
int main(int argc, char **argv)
A fixed-count lock-free pool of the same type of object. Supports both bare- and shared-pointer alloc...
boost::shared_ptr< T > allocateShared()
Allocate a single object from the pool, returning a shared pointer.
TEST(ObjectPool, oneElement)