Commit 91a0d273 authored by Stephen Morris's avatar Stephen Morris
Browse files

[2837] Fixed omissions from previous review corrections

Added braces to a single-line "if" statement.  Also corrected
some comments and removed trailing spaces from some statements.
parent 2b7e75de
......@@ -36,9 +36,10 @@ HWAddr::HWAddr(const uint8_t* hwaddr, size_t len, uint8_t htype)
HWAddr::HWAddr(const std::vector<uint8_t>& hwaddr, uint8_t htype)
:hwaddr_(hwaddr), htype_(htype) {
if (hwaddr.size() > MAX_HWADDR_LEN)
if (hwaddr.size() > MAX_HWADDR_LEN) {
"address vector size exceeds MAX_HWADDR_LEN");
std::string HWAddr::toText() const {
......@@ -42,7 +42,7 @@ TEST(HWAddrTest, constructor) {
const uint8_t htype = HTYPE_ETHER;
vector<uint8_t> data2(data1, data1 + sizeof(data1));
// over the limit data
// Over the limit data
vector<uint8_t> big_data_vector(HWAddr::MAX_HWADDR_LEN + 1, 0);
scoped_ptr<HWAddr> hwaddr1(new HWAddr(data1, sizeof(data1), htype));
......@@ -58,11 +58,11 @@ TEST(HWAddrTest, constructor) {
EXPECT_EQ(0, hwaddr3->hwaddr_.size());
EXPECT_EQ(htype, hwaddr3->htype_);
// check that over the limit data length throws exception
// Check that over the limit data length throws exception
EXPECT_THROW(HWAddr(&big_data_vector[0], big_data_vector.size(), HTYPE_ETHER),
// check that over the limit vector throws exception
// Check that over the limit vector throws exception
EXPECT_THROW(HWAddr(big_data_vector, HTYPE_ETHER), InvalidParameter);
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