Commit 69c0bc98 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

added some getters for MX


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@221 e5f2f494-b856-4b98-b285-d166d9295462
parent 40b10346
......@@ -177,6 +177,8 @@ public:
unsigned int count() const { return (1); }
const RRType& getType() const { return (RRType::MX); }
static const RRType& getTypeStatic() { return (RRType::MX); }
uint16_t getPreference() const { return (preference_); }
const Name getMXName() const { return (mxname_); }
std::string toText() const;
void toWire(Buffer& buffer, NameCompressor& compressor) const;
bool operator==(const MX& other) const
......
......@@ -169,6 +169,12 @@ TEST_F(Rdata_Generic_MX_Test, fromToText)
EXPECT_EQ("10 mail.example.com.", rdata.toText());
}
TEST_F(Rdata_Generic_MX_Test, getFields)
{
EXPECT_EQ(10, rdata.getPreference());
EXPECT_EQ("mail.example.com.", rdata.getMXName().toText());
}
// The fixture for testing Generic/TXT Rdata class
class Rdata_Generic_TXT_Test : public ::testing::Test {
protected:
......
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