container_test::Entity_test Class Reference

Unit tests for Entity. More...

List of all members.

Protected Member Functions

 Entity_test ()
virtual ~Entity_test ()
virtual void SetUp ()
virtual void TearDown ()
void foo (Entity x)
void copyConstructorTestCore (Entity &b)
void assignmentOperatorTestCore (Entity &a, Entity &b)


Detailed Description

Unit tests for Entity.

Constructor & Destructor Documentation

container_test::Entity_test::Entity_test (  )  [inline, protected]

00057                  {
00058       // You can do set-up work for each test here.
00059    }

virtual container_test::Entity_test::~Entity_test (  )  [inline, protected, virtual]

00061                           {
00062       // You can do clean-up work that doesn't throw exceptions here.
00063    }


Member Function Documentation

void container_test::Entity_test::assignmentOperatorTestCore ( Entity a,
Entity b 
) [inline, protected]

00106                                                          {
00107       // Invoke assignment method.
00108       cout << "Before assignment a = b" << endl;
00109       cout << "       a " << a << endl;
00110       cout << "       b " << b << endl;
00111       a = b;
00112       cout << "After  a " << a << endl;
00113       EXPECT_TRUE(a.compareKeyTo(b) == 0);
00114 
00115       // a and b should be independent objects. Again, testing my understanding.
00116       EXPECT_NE(&a, &b);
00117 
00118       // keyAsString members should be independent objects
00119       EXPECT_NE(&(a.getKeyAsString()), &(b.getKeyAsString()));
00120    }

Here is the call graph for this function:

void container_test::Entity_test::copyConstructorTestCore ( Entity b  )  [inline, protected]

00085                                            {
00086       Entity* a = NULL;
00087 
00088       // Execute copy constructor explicitly.
00089       cout << "Before copy constructor a = new Entity(b)" << endl;
00090       cout << "       a is NULL" << endl;
00091       cout << "       b " << b << endl;
00092       a = new Entity(b);
00093       cout << "After  a " << *a << endl;
00094 
00095       EXPECT_TRUE(a->compareKeyTo(b) == 0);
00096 
00097       // a and b should be independent objects. Again, testing my understanding.
00098       EXPECT_NE(a, &b);
00099 
00100       // keyAsString members should be independent objects
00101       EXPECT_NE(&(a->getKeyAsString()), &(b.getKeyAsString()));
00102 
00103       delete a;
00104    }

Here is the call graph for this function:

void container_test::Entity_test::foo ( Entity  x  )  [inline, protected]

00080                       {
00081       cout << "In pass by value foo(x)" << endl;
00082       cout << "  x " << x << endl;
00083    }

virtual void container_test::Entity_test::SetUp (  )  [inline, protected, virtual]

00068                         {
00069       // Code here will be called immediately after the constructor (right
00070       // before each test).
00071    }

virtual void container_test::Entity_test::TearDown (  )  [inline, protected, virtual]

00073                            {
00074       // Code here will be called immediately after each test (right
00075       // before the destructor).
00076    }


The documentation for this class was generated from the following file:

Generated on Tue Jun 16 23:13:02 2009 by  doxygen 1.5.9