Browse Source

[trac1057] it turned out logcheck.h had the same problem. applied the
same sense of fixes (introducing a separate named namespace; avoid
'using namespace' in the header file).

JINMEI Tatuya 14 years ago
parent
commit
b3a9a4228b
3 changed files with 18 additions and 8 deletions
  1. 7 1
      src/lib/acl/tests/acl_test.cc
  2. 1 0
      src/lib/acl/tests/loader_test.cc
  3. 10 7
      src/lib/acl/tests/logcheck.h

+ 7 - 1
src/lib/acl/tests/acl_test.cc

@@ -12,8 +12,14 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <boost/shared_ptr.hpp>
+
 #include "logcheck.h"
 
+using namespace isc::acl;
+using namespace isc::acl::tests;
+using boost::shared_ptr;
+
 namespace {
 
 // Test version of the Acl class. It adds few methods to examine the protected
@@ -39,7 +45,7 @@ public:
     TestACL acl_;
     Log log_;
     size_t next_check_;
-    shared_ptr<Check<Log> > getCheck(bool accepts) {
+    boost::shared_ptr<Check<Log> > getCheck(bool accepts) {
         return (shared_ptr<Check<Log> >(new ConstCheck(accepts,
                                                        next_check_++)));
     }

+ 1 - 0
src/lib/acl/tests/loader_test.cc

@@ -19,6 +19,7 @@
 
 using namespace std;
 using namespace boost;
+using namespace isc::acl;
 using namespace isc::acl::tests;
 using isc::data::Element;
 using isc::data::ConstElementPtr;

+ 10 - 7
src/lib/acl/tests/logcheck.h

@@ -19,14 +19,11 @@
 #include <acl/acl.h>
 #include <cassert>
 
-// This is not a public header, it is used only inside the tests. Therefore
-// we lower the standards a bit and use anonymous namespace in the header
-// and "using", just for convenience. This is just to share little bit of code
-// between multiple tests.
-using namespace isc::acl;
-using boost::shared_ptr;
+// This is not a public header, it is used only inside the tests.
 
-namespace {
+namespace isc {
+namespace acl {
+namespace tests {
 
 // This is arbitrary guess of size for the log. If it's too small for your
 // test, just make it bigger.
@@ -87,5 +84,11 @@ private:
 };
 
 }
+}
+}
 
 #endif
+
+// Local Variables:
+// mode: c++
+// End: