]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1396] Rename method to getLength()
authorMukund Sivaraman <muks@isc.org>
Tue, 28 Jan 2014 02:51:48 +0000 (08:21 +0530)
committerMukund Sivaraman <muks@isc.org>
Tue, 28 Jan 2014 02:52:41 +0000 (08:22 +0530)
At first I thought getLength() may already be in use by RR type-specific
classes, but it's not in use. getLength() is more consistent with naming
of other classes' wire data length methods.

src/lib/dns/rdata.cc
src/lib/dns/rdata.h
src/lib/dns/tests/rdata_unittest.cc

index 09f289b7dd1169698055f5f4f4e06c62207b79aa..ff95fee6b095ce81bc368577b96831db88b99e88 100644 (file)
@@ -47,7 +47,7 @@ namespace dns {
 namespace rdata {
 
 uint16_t
-Rdata::getWireLength() const {
+Rdata::getLength() const {
     OutputBuffer obuffer(0);
 
     toWire(obuffer);
index 352554e1affd51eba524c7cb127ae8ee68eb7bf2..79ca641c8073903ff8addc383938325acec32261 100644 (file)
@@ -227,15 +227,15 @@ public:
     /// IMPLEMENTATION NOTE: Currently this base class implementation is
     /// non-optimal as it renders the wire data to a buffer and returns
     /// the buffer's length. What would perform better is to add
-    /// implementations of \c getWireLength() method to every RDATA
+    /// implementations of \c getLength() method to every RDATA
     /// type. This is why this method is virtual. Once all Rdata types
-    /// have \c getWireLength() implementations, this base class
+    /// have \c getLength() implementations, this base class
     /// implementation must be removed and the method should become a
     /// pure interface.
     ///
     /// \return The length of the wire format representation of the
     /// RDATA.
-    virtual uint16_t getWireLength() const;
+    virtual uint16_t getLength() const;
 };
 
 namespace generic {
index 3772e9b4b0c3c90540993fad2a22448295003703..1678f0b1eb3a649ca37eecb248af74723ae3bbf3 100644 (file)
@@ -211,12 +211,12 @@ TEST_F(RdataTest, createRdataWithLexer) {
                    "file does not end with newline");
 }
 
-TEST_F(RdataTest, getWireLength) {
+TEST_F(RdataTest, getLength) {
     const in::AAAA aaaa_rdata("2001:db8::1");
-    EXPECT_EQ(16, aaaa_rdata.getWireLength());
+    EXPECT_EQ(16, aaaa_rdata.getLength());
 
     const generic::TXT txt_rdata("Hello World");
-    EXPECT_EQ(12, txt_rdata.getWireLength());
+    EXPECT_EQ(12, txt_rdata.getLength());
 }
 
 }