From: JINMEI Tatuya Date: Tue, 17 Apr 2012 21:49:10 +0000 (-0700) Subject: [1891] (unrelated) cleanup: unify the definition of faked NSEC3 strings. X-Git-Tag: trac2351_base~226^2~116^2~25^2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=358beb2e1e15bcbe09438719e756f8641ea929d5;p=thirdparty%2Fkea.git [1891] (unrelated) cleanup: unify the definition of faked NSEC3 strings. defining const values in a shared header file isn't illegal, but it could cause definition bloat (it's up to the linker implementation whether to combine them). in practice this probably doesn't matter much for this limited scope purpose, but it's still cleaner to avoid the bloat. --- diff --git a/src/lib/datasrc/tests/faked_nsec3.cc b/src/lib/datasrc/tests/faked_nsec3.cc index 4ca22a5563..0a1823b1be 100644 --- a/src/lib/datasrc/tests/faked_nsec3.cc +++ b/src/lib/datasrc/tests/faked_nsec3.cc @@ -28,6 +28,19 @@ namespace isc { namespace datasrc { namespace test { +// Constant data definitions + +const char* const nsec3_common = " 300 IN NSEC3 1 1 12 aabbccdd " + "2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG"; +const char* const nsec3_rrsig_common = " 300 IN RRSIG NSEC3 5 3 3600 " + "20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"; +const char* const apex_hash = "0P9MHAVEQVM6T7VBL5LOP2U3T2RP3TOM"; +const char* const apex_hash_lower = "0p9mhaveqvm6t7vbl5lop2u3t2rp3tom"; +const char* const ns1_hash = "2T7B4G4VSA5SMI47K61MV5BV1A22BOJR"; +const char* const w_hash = "01UDEMVP1J2F7EG6JEBPS17VP3N8I58H"; +const char* const xyw_hash = "2vptu5timamqttgl4luu9kg21e0aor3s"; +const char* const zzz_hash = "R53BQ7CC2UVMUBFU5OCMM6PERS9TK9EN"; + class TestNSEC3HashCreator::TestNSEC3Hash : public NSEC3Hash { private: typedef map NSEC3HashMap; diff --git a/src/lib/datasrc/tests/faked_nsec3.h b/src/lib/datasrc/tests/faked_nsec3.h index 51b40593d5..10d944493c 100644 --- a/src/lib/datasrc/tests/faked_nsec3.h +++ b/src/lib/datasrc/tests/faked_nsec3.h @@ -31,26 +31,24 @@ namespace test { // // Commonly used NSEC3 suffix. It's incorrect to use it for all NSEC3s, but // doesn't matter for the purpose of our tests. -const char* const nsec3_common = " 300 IN NSEC3 1 1 12 aabbccdd " - "2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG"; +extern const char* const nsec3_common; // Likewise, common RRSIG suffix for NSEC3s. -const char* const nsec3_rrsig_common = " 300 IN RRSIG NSEC3 5 3 3600 " - "20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"; +extern const char* const nsec3_rrsig_common; // Some faked NSEC3 hash values commonly used in tests and the faked NSEC3Hash // object. // // For apex (example.org) -const char* const apex_hash = "0P9MHAVEQVM6T7VBL5LOP2U3T2RP3TOM"; -const char* const apex_hash_lower = "0p9mhaveqvm6t7vbl5lop2u3t2rp3tom"; +extern const char* const apex_hash; +extern const char* const apex_hash_lower; // For ns1.example.org -const char* const ns1_hash = "2T7B4G4VSA5SMI47K61MV5BV1A22BOJR"; +extern const char* const ns1_hash; // For w.example.org -const char* const w_hash = "01UDEMVP1J2F7EG6JEBPS17VP3N8I58H"; +extern const char* const w_hash; // For x.y.w.example.org (lower-cased) -const char* const xyw_hash = "2vptu5timamqttgl4luu9kg21e0aor3s"; +extern const char* const xyw_hash; // For zzz.example.org. -const char* const zzz_hash = "R53BQ7CC2UVMUBFU5OCMM6PERS9TK9EN"; +extern const char* const zzz_hash; // A simple faked NSEC3 hash calculator with a dedicated creator for it. // @@ -83,4 +81,8 @@ performNSEC3Test(ZoneFinder &finder); } } -#endif +#endif // FAKED_NSEC3_H + +// Local Variables: +// mode: c++ +// End: