proxygen
sample3_unittest.cc File Reference
#include "sample3-inl.h"
#include "gtest/gtest.h"

Go to the source code of this file.

Classes

class  QueueTest
 

Functions

 TEST_F (QueueTest, DefaultConstructor)
 
 TEST_F (QueueTest, Dequeue)
 
 TEST_F (QueueTest, Map)
 

Function Documentation

TEST_F ( QueueTest  ,
DefaultConstructor   
)

Definition at line 123 of file sample3_unittest.cc.

References EXPECT_EQ, QueueTest::q0_, and Queue< E >::Size().

123  {
124  // You can access data in the test fixture here.
125  EXPECT_EQ(0u, q0_.Size());
126 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
TEST_F ( QueueTest  ,
Dequeue   
)

Definition at line 129 of file sample3_unittest.cc.

References ASSERT_TRUE, Queue< E >::Dequeue(), EXPECT_EQ, EXPECT_TRUE, QueueTest::q0_, QueueTest::q1_, QueueTest::q2_, and Queue< E >::Size().

129  {
130  int * n = q0_.Dequeue();
131  EXPECT_TRUE(n == NULL);
132 
133  n = q1_.Dequeue();
134  ASSERT_TRUE(n != NULL);
135  EXPECT_EQ(1, *n);
136  EXPECT_EQ(0u, q1_.Size());
137  delete n;
138 
139  n = q2_.Dequeue();
140  ASSERT_TRUE(n != NULL);
141  EXPECT_EQ(2, *n);
142  EXPECT_EQ(1u, q2_.Size());
143  delete n;
144 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865
TEST_F ( QueueTest  ,
Map   
)

Definition at line 147 of file sample3_unittest.cc.

References QueueTest::MapTester(), QueueTest::q0_, QueueTest::q1_, and QueueTest::q2_.

147  {
148  MapTester(&q0_);
149  MapTester(&q1_);
150  MapTester(&q2_);
151 }