Commit 538098d8 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

use getQR() rather than getQr() etc.


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@147 e5f2f494-b856-4b98-b285-d166d9295462
parent bfc4f0f2
......@@ -245,19 +245,19 @@ Message::toText() const
s += ", status: " + std::string(rcodetext[rcode_]);
s += ", id: " + boost::lexical_cast<std::string>(qid_);
s += "\n;; flags: ";
if (getQr())
if (getQR())
s += "qr ";
if (getAa())
if (getAA())
s += "aa ";
if (getTc())
if (getTC())
s += "tc ";
if (getRd())
if (getRD())
s += "rd ";
if (getRa())
if (getRA())
s += "ra ";
if (getAd())
if (getAD())
s += "ad ";
if (getCd())
if (getCD())
s += "cd ";
// for simply, don't consider the update case
......@@ -320,7 +320,7 @@ void
Message::makeResponse()
{
flags_ &= MESSAGE_REPLYPRESERVE;
setQr(true);
setQR(true);
for (int section = SECTION_ANSWER; section < SECTION_MAX; ++section) {
sections_[section].clear();
......
......@@ -46,14 +46,14 @@ public:
void sort(Message& message, section_t section) {} // dummy for now.
};
#define getMsgFlg(flg, capflg) \
bool get ## flg() const { return ((flags_ & FLAG_ ## capflg) != 0); }
#define setMsgFlg(flg, capflg) \
bool set ## flg(bool on) { \
#define getMsgFlg(flag) \
bool get ## flag() const { return ((flags_ & FLAG_ ## flag) != 0); }
#define setMsgFlg(flag) \
bool set ## flag(bool on) { \
if (on) \
flags_ |= FLAG_ ## capflg; \
flags_ |= FLAG_ ## flag; \
else \
flags_ &= ~FLAG_ ## capflg; \
flags_ &= ~FLAG_ ## flag; \
}
class Message {
......@@ -62,20 +62,20 @@ public:
~Message();
qid_t getQid() const { return (qid_); }
void setQid(qid_t qid) { qid_ = qid; }
getMsgFlg(Rd, RD)
setMsgFlg(Rd, RD)
getMsgFlg(Aa, AA)
setMsgFlg(Aa, AA)
getMsgFlg(Qr, QR)
setMsgFlg(Qr, QR)
getMsgFlg(Tc, TC)
setMsgFlg(Tc, TC)
getMsgFlg(Ra, RA)
setMsgFlg(Ra, RA)
getMsgFlg(Ad, AD)
setMsgFlg(Ad, AD)
getMsgFlg(Cd, CD)
setMsgFlg(Cd, CD)
getMsgFlg(RD)
setMsgFlg(RD)
getMsgFlg(AA)
setMsgFlg(AA)
getMsgFlg(QR)
setMsgFlg(QR)
getMsgFlg(TC)
setMsgFlg(TC)
getMsgFlg(RA)
setMsgFlg(RA)
getMsgFlg(AD)
setMsgFlg(AD)
getMsgFlg(CD)
setMsgFlg(CD)
rcode_t getRcode() const { return (rcode_); }
void setRcode(rcode_t rcode) { rcode_ = rcode; }
opcode_t getOpcode() const { return (opcode_); }
......
......@@ -49,33 +49,33 @@ protected:
TEST_F(MessageTest, check_flags)
{
EXPECT_EQ(false, query.getQr());
query.setQr(true);
EXPECT_EQ(true, query.getQr());
EXPECT_EQ(false, query.getQR());
query.setQR(true);
EXPECT_EQ(true, query.getQR());
EXPECT_EQ(false, query.getAa());
query.setAa(true);
EXPECT_EQ(true, query.getAa());
EXPECT_EQ(false, query.getAA());
query.setAA(true);
EXPECT_EQ(true, query.getAA());
EXPECT_EQ(false, query.getTc());
query.setTc(true);
EXPECT_EQ(true, query.getTc());
EXPECT_EQ(false, query.getTC());
query.setTC(true);
EXPECT_EQ(true, query.getTC());
EXPECT_EQ(false, query.getRd());
query.setRd(true);
EXPECT_EQ(true, query.getRd());
EXPECT_EQ(false, query.getRD());
query.setRD(true);
EXPECT_EQ(true, query.getRD());
EXPECT_EQ(false, query.getRa());
query.setRa(true);
EXPECT_EQ(true, query.getRa());
EXPECT_EQ(false, query.getRA());
query.setRA(true);
EXPECT_EQ(true, query.getRA());
EXPECT_EQ(false, query.getAd());
query.setAd(true);
EXPECT_EQ(true, query.getAd());
EXPECT_EQ(false, query.getAD());
query.setAD(true);
EXPECT_EQ(true, query.getAD());
EXPECT_EQ(false, query.getCd());
query.setCd(true);
EXPECT_EQ(true, query.getCd());
EXPECT_EQ(false, query.getCD());
query.setCD(true);
EXPECT_EQ(true, query.getCD());
}
TEST_F(MessageTest, getQuestion)
......@@ -88,7 +88,7 @@ TEST_F(MessageTest, getQuestion)
TEST_F(MessageTest, makeResponse)
{
query.makeResponse();
EXPECT_EQ(true, query.getQr());
EXPECT_EQ(true, query.getQR());
EXPECT_EQ("www.example.com. IN A",
(**query.getSection(SECTION_QUESTION).begin()).toText());
EXPECT_EQ(0, query.getSection(SECTION_ANSWER).size());
......
Markdown is supported
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