Browse Source

Revert "[510] do not use BOOST_FOREACH to address build failure on Mac OS X"

This reverts commit 1cd21e93810b18a4aa90d7d20afa6dbc3c0a8861.
Yoshitaka Aharen 13 years ago
parent
commit
7a5214fa8a
1 changed files with 8 additions and 10 deletions
  1. 8 10
      src/lib/statistics/tests/counter_dict_unittest.cc

+ 8 - 10
src/lib/statistics/tests/counter_dict_unittest.cc

@@ -118,22 +118,20 @@ TEST_F(CounterDictionaryTest, iteratorTest) {
     // Walk through the elements with iterator
     // Check if the elements "test" and "sub.test" appears only once
     //  and the counters have expected value
-    for (CounterDictionary::ConstIterator i = counters.begin(),
-                                          e = counters.end();
-         i != e;
-         ++i)
+    BOOST_FOREACH(CounterDictionary::ValueType i,
+                  static_cast<const CounterDictionary &>(counters))
     {
-        if (i->name == "test" && element_test_visited == false) {
+        if (i.name == "test" && element_test_visited == false) {
             element_test_visited = true;
             // Check if the counters have expected value
-            EXPECT_EQ(i->element.get(ITEM1), 1);
-            EXPECT_EQ(i->element.get(ITEM2), 0);
-        } else if (i->name == "sub.test" &&
+            EXPECT_EQ(i.element.get(ITEM1), 1);
+            EXPECT_EQ(i.element.get(ITEM2), 0);
+        } else if (i.name == "sub.test" &&
                    element_sub_test_visited == false) {
             element_sub_test_visited = true;
             // Check if the counters have expected value
-            EXPECT_EQ(i->element.get(ITEM1), 0);
-            EXPECT_EQ(i->element.get(ITEM2), 2);
+            EXPECT_EQ(i.element.get(ITEM1), 0);
+            EXPECT_EQ(i.element.get(ITEM2), 2);
         } else {
             // Test fails when reaches here: the element is not expected or
             //  the element appeared twice