Commit 870cc9bc authored by Paul Selkirk's avatar Paul Selkirk
Browse files

[2521] enabled previously disabled rrsig test

also changed createFromLexer from static function to private method
parent fdb992f0
......@@ -74,9 +74,8 @@ struct RRSIGImpl {
const vector<uint8_t> signature_;
};
namespace {
// helper function for string and lexer constructors
RRSIGImpl* createFromLexer(MasterLexer& lexer, const Name* origin)
void RRSIG::createFromLexer(MasterLexer& lexer, const Name* origin)
{
string covered_txt, expire_txt, inception_txt, signature_txt;
unsigned int algorithm, labels, tag;
......@@ -108,11 +107,10 @@ RRSIGImpl* createFromLexer(MasterLexer& lexer, const Name* origin)
vector<uint8_t> signature;
decodeBase64(signature_txt, signature);
return new RRSIGImpl(RRType(covered_txt), algorithm, labels,
impl_ = new RRSIGImpl(RRType(covered_txt), algorithm, labels,
originalttl, timeexpire, timeinception,
static_cast<uint16_t>(tag), signer, signature);
}
}
/// \brief Constructor from string.
///
......@@ -138,7 +136,7 @@ RRSIG::RRSIG(const std::string& rrsig_str) :
MasterLexer lexer;
lexer.pushSource(iss);
impl_ = createFromLexer(lexer, NULL);
createFromLexer(lexer, NULL);
if (lexer.getNextToken().getType() != MasterToken::END_OF_FILE) {
isc_throw(InvalidRdataText, "extra input text for RRSIG: "
......@@ -173,7 +171,7 @@ RRSIG::RRSIG(MasterLexer& lexer, const Name* origin,
MasterLoader::Options, MasterLoaderCallbacks&) :
impl_(NULL)
{
impl_ = createFromLexer(lexer, origin);
createFromLexer(lexer, origin);
}
RRSIG::RRSIG(InputBuffer& buffer, size_t rdata_len) {
......
// Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-2013 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -42,6 +42,9 @@ public:
// specialized methods
const RRType& typeCovered() const;
private:
// helper function for string and lexer constructors
void createFromLexer(MasterLexer& lexer, const Name* origin);
RRSIGImpl* impl_;
};
......
......@@ -99,12 +99,9 @@ TEST_F(Rdata_RRSIG_Test, badText) {
"20100223214617 20100222214617 8496 isc.org. "
"EEeeeeeeEEEeeeeeeGaaahAAAAAAAAHHHHHHHHHHH!="),
BadValue);
}
TEST_F(Rdata_RRSIG_Test, DISABLED_badText) {
// this currently fails
// no space between the tag and signer
EXPECT_THROW(generic::RRSIG("A 5 4 43200 20100223214617 20100222214617 "
EXPECT_THROW(const generic::RRSIG sig(
"A 5 4 43200 20100223214617 20100222214617 "
"8496isc.org. ofc="), InvalidRdataText);
}
......
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