Browse Source

[3344] Remove static objects

Mukund Sivaraman 11 years ago
parent
commit
4ec8c2bf8c
1 changed files with 18 additions and 11 deletions
  1. 18 11
      src/lib/dns/tests/rdata_unittest.cc

+ 18 - 11
src/lib/dns/tests/rdata_unittest.cc

@@ -227,10 +227,28 @@ TEST_F(RdataTest, getLength) {
 }
 }
 
 
 namespace {
 namespace {
+
+// Wire-format data correspond to rdata_unknown.  Note that it doesn't
+// include RDLENGTH.
+const uint8_t wiredata_unknown[] = { 0xa1, 0xb2, 0xc3, 0x0d };
+
 class Rdata_Unknown_Test : public RdataTest {
 class Rdata_Unknown_Test : public RdataTest {
+public:
+    Rdata_Unknown_Test() :
+        // "Unknown" RR Type used for the test cases below.  If/when we
+        // use this type number as a "well-known" (probably
+        // experimental) type, we'll need to renumber it.
+        unknown_rrtype(RRType(65000)),
+        rdata_unknowntxt("\\# 4 a1b2c30d"),
+        rdata_unknown(rdata_unknowntxt)
+    {}
 protected:
 protected:
     static string getLongestRdataTxt();
     static string getLongestRdataTxt();
     static void getLongestRdataWire(vector<uint8_t>& v);
     static void getLongestRdataWire(vector<uint8_t>& v);
+
+    const RRType unknown_rrtype;
+    const std::string rdata_unknowntxt;
+    const generic::Generic rdata_unknown;
 };
 };
 
 
 string
 string
@@ -255,17 +273,6 @@ Rdata_Unknown_Test::getLongestRdataWire(vector<uint8_t>& v) {
     }
     }
 }
 }
 
 
-const string rdata_unknowntxt("\\# 4 a1b2c30d");
-const generic::Generic rdata_unknown(rdata_unknowntxt);
-// Wire-format data correspond to rdata_unknown.  Note that it doesn't include
-// RDLENGTH
-const uint8_t wiredata_unknown[] = { 0xa1, 0xb2, 0xc3, 0x0d };
-
-// "Unknown" RR Type used for the test cases below.  If/when we use this
-// type number as a "well-known" (probably experimental) type, we'll need to
-// renumber it.
-const RRType unknown_rrtype = RRType(65000);
-
 TEST_F(Rdata_Unknown_Test, createFromText) {
 TEST_F(Rdata_Unknown_Test, createFromText) {
     // valid construction.  This also tests a normal case of "FromWire".
     // valid construction.  This also tests a normal case of "FromWire".
     EXPECT_EQ(0, generic::Generic("\\# 4 a1b2c30d").compare(
     EXPECT_EQ(0, generic::Generic("\\# 4 a1b2c30d").compare(