22 #include "gtest/gtest.h"
23 #include "boost/smart_ptr.hpp"
28 class ManagedIDsTest :
public ::testing::Test {
36 virtual ~ManagedIDsTest() {
43 virtual void SetUp() {
48 virtual void TearDown() {
54 boost::scoped_ptr<ManagedIDs> ids_;
57 TEST_F(ManagedIDsTest, OneID) {
59 size_t id = ids_->nextID();
60 EXPECT_EQ(
static_cast<size_t>(0),
id) <<
"first id should be 0";
63 TEST_F(ManagedIDsTest, IDsContinuous) {
65 size_t id0 = ids_->nextID();
66 size_t id1 = ids_->nextID();
67 EXPECT_EQ(id0 + 1, id1);
70 TEST_F(ManagedIDsTest, ReusingFreedIDs) {
72 size_t id0 = ids_->nextID();
74 size_t id1 = ids_->nextID();
80 int main(
int argc,
char **argv) {
81 ::testing::InitGoogleTest(&argc, argv);
82 return RUN_ALL_TESTS();
int main(int argc, char **argv)