Browse Source

[trac998] Put file-scope data in anonymous namespace

Stephen Morris 14 years ago
parent
commit
309b24ff46
1 changed files with 17 additions and 13 deletions
  1. 17 13
      src/lib/acl/tests/ip_check_unittest.cc

+ 17 - 13
src/lib/acl/tests/ip_check_unittest.cc

@@ -316,63 +316,67 @@ TEST(IPCheck, V4Compare) {
 
 // Some constants used in the tests
 
-static const char* V6ADDR_1_STRING = "2001:0db8:1122:3344:5566:7788:99aa:bbcc";
-static const uint8_t V6ADDR_1[] = {
+namespace {
+
+const char* V6ADDR_1_STRING = "2001:0db8:1122:3344:5566:7788:99aa:bbcc";
+const uint8_t V6ADDR_1[] = {
     0x20, 0x01, 0x0d, 0xb8, 0x11, 0x22, 0x33, 0x44,
     0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc
 };
 
-static const char* V6ADDR_2_STRING = "2001:0db8::dead:beef";
-static const uint8_t V6ADDR_2[] = {
+const char* V6ADDR_2_STRING = "2001:0db8::dead:beef";
+const uint8_t V6ADDR_2[] = {
     0x20, 0x01, 0x0d, 0xb8, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0xde, 0xad, 0xbe, 0xef
 };
 
 // Identical to V6ADDR_2 to 48 bits
-static const uint8_t V6ADDR_2_48[] = {
+const uint8_t V6ADDR_2_48[] = {
     0x20, 0x01, 0x0d, 0xb8, 0x00, 0x00, 0x55, 0x66,
     0x00, 0x00, 0x00, 0x00, 0xde, 0xad, 0xbe, 0xef
 };
 
 // Identical to V6ADDR_2 to 52 bits
-static const uint8_t V6ADDR_2_52[] = {
+const uint8_t V6ADDR_2_52[] = {
     0x20, 0x01, 0x0d, 0xb8, 0x00, 0x00, 0x05, 0x66,
     0x00, 0x00, 0x00, 0x00, 0xde, 0xad, 0xbe, 0xef
 };
 
-static const char* V6ADDR_3_STRING = "::1";
-static const uint8_t V6ADDR_3[] = {
+const char* V6ADDR_3_STRING = "::1";
+const uint8_t V6ADDR_3[] = {
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
 };
 
 
 // Mask with MS bit set
-static const uint8_t MASK_1[] = {
+const uint8_t MASK_1[] = {
     0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
-static const uint8_t MASK_8[] = {
+const uint8_t MASK_8[] = {
     0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
-static const uint8_t MASK_48[] = {
+const uint8_t MASK_48[] = {
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
-static const uint8_t MASK_51[] = {
+const uint8_t MASK_51[] = {
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
-static const uint8_t MASK_128[] = {
+const uint8_t MASK_128[] = {
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
     0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
 };
 
+} // Anonymous namespace
+
 // Check that a default constructor can be instantiated.
 
 TEST(IPCheck, V6ConstructorAddress) {