]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Avoid static init fiasco in libdns++ unittests due to merge of #2390, #2656
authorMukund Sivaraman <muks@isc.org>
Fri, 1 Feb 2013 13:32:32 +0000 (19:02 +0530)
committerMukund Sivaraman <muks@isc.org>
Fri, 1 Feb 2013 13:32:32 +0000 (19:02 +0530)
src/lib/dns/tests/rdata_cname_unittest.cc
src/lib/dns/tests/rdata_dname_unittest.cc
src/lib/dns/tests/rdata_mx_unittest.cc
src/lib/dns/tests/rdata_ns_unittest.cc
src/lib/dns/tests/rdata_ptr_unittest.cc
src/lib/dns/tests/rdata_srv_unittest.cc

index c00cab7e1dbb659717f02df587b086db25c58c38..5f602f011e3c1972a1a244577c3db8b869043792 100644 (file)
@@ -33,11 +33,16 @@ using namespace isc::dns::rdata;
 
 namespace {
 class Rdata_CNAME_Test : public RdataTest {
-    // there's nothing to specialize
+public:
+    Rdata_CNAME_Test() :
+        rdata_cname("cn.example.com."),
+        rdata_cname2("cn2.example.com.")
+    {}
+
+    const generic::CNAME rdata_cname;
+    const generic::CNAME rdata_cname2;
 };
 
-const generic::CNAME rdata_cname("cn.example.com.");
-const generic::CNAME rdata_cname2("cn2.example.com.");
 const uint8_t wiredata_cname[] = {
     0x02, 0x63, 0x6e, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03,
     0x63, 0x6f, 0x6d, 0x00 };
index 5b6d9ac4eed5186859e03182435064dfd881abd6..7209e36e61256110dd129e28eab10a3c2febcc3d 100644 (file)
@@ -33,11 +33,16 @@ using namespace isc::dns::rdata;
 
 namespace {
 class Rdata_DNAME_Test : public RdataTest {
-    // there's nothing to specialize
+public:
+    Rdata_DNAME_Test() :
+        rdata_dname("dn.example.com."),
+        rdata_dname2("dn2.example.com.")
+    {}
+
+    const generic::DNAME rdata_dname;
+    const generic::DNAME rdata_dname2;
 };
 
-const generic::DNAME rdata_dname("dn.example.com.");
-const generic::DNAME rdata_dname2("dn2.example.com.");
 const uint8_t wiredata_dname[] = {
     0x02, 0x64, 0x6e, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03,
     0x63, 0x6f, 0x6d, 0x00 };
index f4d0abbbdef6741a1d2e8af24731e5cf565e723d..6e4eaba41fcf8e173d1d92f230036f0f76841a70 100644 (file)
@@ -32,10 +32,13 @@ using namespace isc::dns::rdata;
 
 namespace {
 class Rdata_MX_Test : public RdataTest {
-    // there's nothing to specialize
-};
+public:
+    Rdata_MX_Test() :
+        rdata_mx(10, Name("mx.example.com"))
+    {}
 
-const generic::MX rdata_mx(10, Name("mx.example.com"));
+    const generic::MX rdata_mx;
+};
 
 TEST_F(Rdata_MX_Test, createFromText) {
     const generic::MX rdata_mx2("10 mx.example.com.");
index a6f5a98dab11ca86db03849bc7ff925e0ca93c45..53eb6700c3134a16348c169fef6c3f50462e0fda 100644 (file)
@@ -33,11 +33,16 @@ using namespace isc::dns::rdata;
 
 namespace {
 class Rdata_NS_Test : public RdataTest {
-    // there's nothing to specialize
+public:
+    Rdata_NS_Test() :
+        rdata_ns("ns.example.com."),
+        rdata_ns2("ns2.example.com.")
+    {}
+
+    const generic::NS rdata_ns;
+    const generic::NS rdata_ns2;
 };
 
-const generic::NS rdata_ns("ns.example.com.");
-const generic::NS rdata_ns2("ns2.example.com.");
 const uint8_t wiredata_ns[] = {
     0x02, 0x6e, 0x73, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03,
     0x63, 0x6f, 0x6d, 0x00 };
index 9378c5e61f880700b4af6f49c453a7a8720d8795..5d6d37db91955e70499a9a5e7403d9c1758a7dde 100644 (file)
@@ -37,11 +37,16 @@ using namespace isc::dns::rdata;
 
 namespace {
 class Rdata_PTR_Test : public RdataTest {
-    // there's nothing to specialize
+public:
+     Rdata_PTR_Test() :
+         rdata_ptr("ns.example.com."),
+         rdata_ptr2("ns2.example.com.")
+     {}
+
+     const generic::PTR rdata_ptr;
+     const generic::PTR rdata_ptr2;
 };
 
-const generic::PTR rdata_ptr("ns.example.com.");
-const generic::PTR rdata_ptr2("ns2.example.com.");
 const uint8_t wiredata_ptr[] = {
     0x02, 0x6e, 0x73, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03,
     0x63, 0x6f, 0x6d, 0x00 };
index a3d772115cb8be90fbe6971c31922f52997fa720..6ca0c7fe7a6bb36e1437278cb87dd899b94ab0a1 100644 (file)
@@ -33,14 +33,23 @@ using namespace isc::dns::rdata;
 
 namespace {
 class Rdata_SRV_Test : public RdataTest {
-    // there's nothing to specialize
+public:
+    Rdata_SRV_Test() :
+        srv_txt("1 5 1500 a.example.com."),
+        srv_txt2("1 5 1400 example.com."),
+        too_long_label("012345678901234567890123456789"
+                       "0123456789012345678901234567890123."),
+        rdata_srv(srv_txt),
+        rdata_srv2(srv_txt2)
+    {}
+
+    const string srv_txt;
+    const string srv_txt2;
+    const string too_long_label;
+    const in::SRV rdata_srv;
+    const in::SRV rdata_srv2;
 };
 
-string srv_txt("1 5 1500 a.example.com.");
-string srv_txt2("1 5 1400 example.com.");
-string too_long_label("012345678901234567890123456789"
-    "0123456789012345678901234567890123.");
-
 // 1 5 1500 a.example.com.
 const uint8_t wiredata_srv[] = {
     0x00, 0x01, 0x00, 0x05, 0x05, 0xdc, 0x01, 0x61, 0x07, 0x65, 0x78,
@@ -50,9 +59,6 @@ const uint8_t wiredata_srv2[] = {
     0x00, 0x01, 0x00, 0x05, 0x05, 0x78, 0x07, 0x65, 0x78, 0x61, 0x6d,
     0x70, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00};
 
-const in::SRV rdata_srv(srv_txt);
-const in::SRV rdata_srv2(srv_txt2);
-
 TEST_F(Rdata_SRV_Test, createFromText) {
     EXPECT_EQ(1, rdata_srv.getPriority());
     EXPECT_EQ(5, rdata_srv.getWeight());