summaryrefslogtreecommitdiff
path: root/samples/sample3_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'samples/sample3_unittest.cc')
-rw-r--r--samples/sample3_unittest.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/samples/sample3_unittest.cc b/samples/sample3_unittest.cc
index bf3877d..e093c25 100644
--- a/samples/sample3_unittest.cc
+++ b/samples/sample3_unittest.cc
@@ -28,9 +28,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// A sample program demonstrating using Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
// In this example, we use a more advanced feature of Google Test called
// test fixture.
@@ -65,14 +62,14 @@
#include "sample3-inl.h"
#include "gtest/gtest.h"
-
+namespace {
// To use a test fixture, derive a class from testing::Test.
-class QueueTest : public testing::Test {
+class QueueTestSmpl3 : public testing::Test {
protected: // You should make the members protected s.t. they can be
// accessed from sub-classes.
// virtual void SetUp() will be called before each test is run. You
- // should define it if you need to initialize the varaibles.
+ // should define it if you need to initialize the variables.
// Otherwise, this can be skipped.
virtual void SetUp() {
q1_.Enqueue(1);
@@ -120,13 +117,13 @@ class QueueTest : public testing::Test {
// instead of TEST.
// Tests the default c'tor.
-TEST_F(QueueTest, DefaultConstructor) {
+TEST_F(QueueTestSmpl3, DefaultConstructor) {
// You can access data in the test fixture here.
EXPECT_EQ(0u, q0_.Size());
}
// Tests Dequeue().
-TEST_F(QueueTest, Dequeue) {
+TEST_F(QueueTestSmpl3, Dequeue) {
int * n = q0_.Dequeue();
EXPECT_TRUE(n == NULL);
@@ -144,8 +141,9 @@ TEST_F(QueueTest, Dequeue) {
}
// Tests the Queue::Map() function.
-TEST_F(QueueTest, Map) {
+TEST_F(QueueTestSmpl3, Map) {
MapTester(&q0_);
MapTester(&q1_);
MapTester(&q2_);
}
+} // namespace