Commit 2975fbae authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2302] Untabify and delete trailing whitespace

parent 593b348c
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
/// the type in question. /// the type in question.
/// ///
class Element { class Element {
private: private:
// technically the type could be omitted; is it useful? // technically the type could be omitted; is it useful?
// should we remove it or replace it with a pure virtual // should we remove it or replace it with a pure virtual
...@@ -112,7 +112,7 @@ public: ...@@ -112,7 +112,7 @@ public:
/// \returns true if the other ElementPtr has the same type and /// \returns true if the other ElementPtr has the same type and
/// value /// value
virtual bool equals(const Element& other) const = 0; virtual bool equals(const Element& other) const = 0;
/// Converts the Element to JSON format and appends it to /// Converts the Element to JSON format and appends it to
/// the given stringstream. /// the given stringstream.
virtual void toJSON(std::ostream& ss) const = 0; virtual void toJSON(std::ostream& ss) const = 0;
...@@ -209,7 +209,7 @@ public: ...@@ -209,7 +209,7 @@ public:
virtual size_t size() const; virtual size_t size() const;
//@} //@}
/// \name MapElement functions /// \name MapElement functions
/// ///
/// \brief If the Element on which these functions are called are not /// \brief If the Element on which these functions are called are not
...@@ -258,7 +258,7 @@ public: ...@@ -258,7 +258,7 @@ public:
/// \name Factory functions /// \name Factory functions
// TODO: should we move all factory functions to a different class // TODO: should we move all factory functions to a different class
// so as not to burden the Element base with too many functions? // so as not to burden the Element base with too many functions?
// and/or perhaps even to a separate header? // and/or perhaps even to a separate header?
...@@ -349,7 +349,7 @@ public: ...@@ -349,7 +349,7 @@ public:
/// These function pparse the wireformat at the given stringstream /// These function pparse the wireformat at the given stringstream
/// (of the given length). If there is a parse error an exception /// (of the given length). If there is a parse error an exception
/// of the type isc::cc::DecodeError is raised. /// of the type isc::cc::DecodeError is raised.
//@{ //@{
/// Creates an Element from the wire format in the given /// Creates an Element from the wire format in the given
/// stringstream of the given length. /// stringstream of the given length.
...@@ -495,7 +495,7 @@ public: ...@@ -495,7 +495,7 @@ public:
return (m.find(s) != m.end()); return (m.find(s) != m.end());
} }
void toJSON(std::ostream& ss) const; void toJSON(std::ostream& ss) const;
// we should name the two finds better... // we should name the two finds better...
// find the element at id; raises TypeError if one of the // find the element at id; raises TypeError if one of the
// elements at path except the one we're looking for is not a // elements at path except the one we're looking for is not a
...@@ -569,6 +569,6 @@ bool operator!=(const Element& a, const Element& b); ...@@ -569,6 +569,6 @@ bool operator!=(const Element& a, const Element& b);
} } } }
#endif // _ISC_DATA_H #endif // _ISC_DATA_H
// Local Variables: // Local Variables:
// mode: c++ // mode: c++
// End: // End:
...@@ -112,7 +112,7 @@ TEST(Element, from_and_to_json) { ...@@ -112,7 +112,7 @@ TEST(Element, from_and_to_json) {
std::string s = std::string(pe.what()); std::string s = std::string(pe.what());
EXPECT_EQ("String expected in <string>:1:3", s); EXPECT_EQ("String expected in <string>:1:3", s);
} }
sv.clear(); sv.clear();
sv.push_back("{1}"); sv.push_back("{1}");
//ElementPtr ep = Element::fromJSON("\"aaa\nbbb\"err"); //ElementPtr ep = Element::fromJSON("\"aaa\nbbb\"err");
...@@ -233,7 +233,7 @@ TEST(Element, create_and_value_throws) { ...@@ -233,7 +233,7 @@ TEST(Element, create_and_value_throws) {
EXPECT_THROW(el->contains("foo"), TypeError); EXPECT_THROW(el->contains("foo"), TypeError);
ConstElementPtr tmp; ConstElementPtr tmp;
EXPECT_FALSE(el->find("foo", tmp)); EXPECT_FALSE(el->find("foo", tmp));
el = Element::create(1.1); el = Element::create(1.1);
EXPECT_THROW(el->intValue(), TypeError); EXPECT_THROW(el->intValue(), TypeError);
...@@ -399,7 +399,7 @@ TEST(Element, MapElement) { ...@@ -399,7 +399,7 @@ TEST(Element, MapElement) {
// this function checks the specific functions for ListElements // this function checks the specific functions for ListElements
ElementPtr el = Element::fromJSON("{ \"name\": \"foo\", \"value1\": \"bar\", \"value2\": { \"number\": 42 } }"); ElementPtr el = Element::fromJSON("{ \"name\": \"foo\", \"value1\": \"bar\", \"value2\": { \"number\": 42 } }");
ConstElementPtr el2; ConstElementPtr el2;
EXPECT_EQ(el->get("name")->stringValue(), "foo"); EXPECT_EQ(el->get("name")->stringValue(), "foo");
EXPECT_EQ(el->get("value2")->getType(), Element::map); EXPECT_EQ(el->get("value2")->getType(), Element::map);
...@@ -413,10 +413,10 @@ TEST(Element, MapElement) { ...@@ -413,10 +413,10 @@ TEST(Element, MapElement) {
EXPECT_EQ(el->find("value2/number")->intValue(), 42); EXPECT_EQ(el->find("value2/number")->intValue(), 42);
EXPECT_TRUE(isNull(el->find("value2/nothing/"))); EXPECT_TRUE(isNull(el->find("value2/nothing/")));
EXPECT_EQ(el->find("value1")->stringValue(), "bar"); EXPECT_EQ(el->find("value1")->stringValue(), "bar");
EXPECT_EQ(el->find("value1/")->stringValue(), "bar"); EXPECT_EQ(el->find("value1/")->stringValue(), "bar");
EXPECT_TRUE(el->find("value1", el2)); EXPECT_TRUE(el->find("value1", el2));
EXPECT_EQ("bar", el2->stringValue()); EXPECT_EQ("bar", el2->stringValue());
EXPECT_FALSE(el->find("name/error", el2)); EXPECT_FALSE(el->find("name/error", el2));
...@@ -428,7 +428,7 @@ TEST(Element, MapElement) { ...@@ -428,7 +428,7 @@ TEST(Element, MapElement) {
"9123456789abcdefa123456789abcdefb123456789abcdef" "9123456789abcdefa123456789abcdefb123456789abcdef"
"c123456789abcdefd123456789abcdefe123456789abcdef" "c123456789abcdefd123456789abcdefe123456789abcdef"
"f123456789abcde"); "f123456789abcde");
EXPECT_EQ(255, long_maptag.length()); // check prerequisite EXPECT_EQ(255, long_maptag.length()); // check prerequisite
el = Element::fromJSON("{ \"" + long_maptag + "\": \"bar\"}"); el = Element::fromJSON("{ \"" + long_maptag + "\": \"bar\"}");
EXPECT_EQ("bar", el->find(long_maptag)->stringValue()); EXPECT_EQ("bar", el->find(long_maptag)->stringValue());
...@@ -707,7 +707,7 @@ TEST(Element, merge) { ...@@ -707,7 +707,7 @@ TEST(Element, merge) {
c = Element::fromJSON("{ \"a\": { \"b\": \"c\" } }"); c = Element::fromJSON("{ \"a\": { \"b\": \"c\" } }");
merge(b, a); merge(b, a);
EXPECT_EQ(*b, *c); EXPECT_EQ(*b, *c);
// And some tests with multiple values // And some tests with multiple values
a = Element::fromJSON("{ \"a\": 1, \"b\": true, \"c\": null }"); a = Element::fromJSON("{ \"a\": 1, \"b\": true, \"c\": null }");
b = Element::fromJSON("{ \"a\": 1, \"b\": null, \"c\": \"a string\" }"); b = Element::fromJSON("{ \"a\": 1, \"b\": null, \"c\": \"a string\" }");
......
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