BIND 10 trac510, updated. 60fd293717cc45323cfb10cf06d5bd264fa083cc [510] move declaration into fixture

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Dec 7 15:04:11 UTC 2011


The branch, trac510 has been updated
       via  60fd293717cc45323cfb10cf06d5bd264fa083cc (commit)
      from  2142e8e6f760c577b58747c515c38fcc10168e04 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 60fd293717cc45323cfb10cf06d5bd264fa083cc
Author: Jelte Jansen <jelte at isc.org>
Date:   Wed Dec 7 16:03:57 2011 +0100

    [510] move declaration into fixture

-----------------------------------------------------------------------

Summary of changes:
 src/lib/statistics/tests/counter_unittest.cc |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/statistics/tests/counter_unittest.cc b/src/lib/statistics/tests/counter_unittest.cc
index f97fbff..57d830d 100644
--- a/src/lib/statistics/tests/counter_unittest.cc
+++ b/src/lib/statistics/tests/counter_unittest.cc
@@ -31,13 +31,13 @@ using namespace isc::statistics;
 // This fixture is for testing Counter.
 class CounterTest : public ::testing::Test {
 protected:
-    CounterTest() {}
+    CounterTest() : counter(NUMBER_OF_ITEMS) {}
     ~CounterTest() {}
+
+    Counter counter;
 };
 
 TEST_F(CounterTest, createCounter) {
-    // Create counter
-    Counter counter(NUMBER_OF_ITEMS);
     // Check if the all counters are initialized with 0
     EXPECT_EQ(counter.get(ITEM1), 0);
     EXPECT_EQ(counter.get(ITEM2), 0);
@@ -45,8 +45,6 @@ TEST_F(CounterTest, createCounter) {
 }
 
 TEST_F(CounterTest, incrementCounterItem) {
-    // Create counter
-    Counter counter(NUMBER_OF_ITEMS);
     // Increment counters
     counter.inc(ITEM1);
     counter.inc(ITEM2);
@@ -78,8 +76,6 @@ TEST_F(CounterTest, invalidCounterSize) {
 }
 
 TEST_F(CounterTest, invalidCounterItem) {
-    // Create counter
-    Counter counter(NUMBER_OF_ITEMS);
     // Incrementing out-of-bound counter will cause an isc::OutOfRange
     // exception
     EXPECT_THROW(counter.inc(NUMBER_OF_ITEMS), isc::OutOfRange);




More information about the bind10-changes mailing list