Commit 8131de02 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2096] The RdataReader::getSize

parent 6bcd73aa
......@@ -251,7 +251,7 @@ public:
/// \brief Returns the size of associated data.
///
/// This just returns whatever was passed to the constructor as size.
size_t getSize() const;
size_t getSize() const { return (size_); }
private:
const NameAction name_action_;
const DataAction data_action_;
......
......@@ -468,6 +468,8 @@ public:
boost::bind(renderNameField, &renderer,
additionalRequired(rrtype), _1, _2),
boost::bind(appendData, &data, &current, _1, _2));
// The size matches
EXPECT_EQ(encoded_data.size(), reader.getSize());
if (start_sig) {
current = NULL;
reader.nextSig();
......@@ -492,6 +494,8 @@ public:
// Render the name and the sigs
renderer.writeName(dummy_name2);
renderer.writeData(&data[0], data.size());
// The size matches even after use
EXPECT_EQ(encoded_data.size(), reader.getSize());
}
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment