shill: Removes some anachronistic TODOs, adds data to a test.
This CL does a few, tiny, unrelated things (there're probably more
lines in the commit message).
Many of the TODOs dealt with not instantiating netlink attributes for
messages coming from the kernel after we have the messages instantiate
their own attributes. The decision, since then, has been to let the
user-bound messages re-create any attributes that have already been
created by the message constructor.
There's another TODO that was fixed by an earlier CL that converted a
test to using mock_netlink_manager rather than netlink_manager.
BUG=None
TEST=unittest
Change-Id: I0ebff4f652b2ce83bcb2ba8b08f99d7899fce4d7
Reviewed-on: https://gerrit.chromium.org/gerrit/57800
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
Commit-Queue: Wade Guthrie <wdg@chromium.org>
diff --git a/attribute_list.h b/attribute_list.h
index c8186ce..71de599 100644
--- a/attribute_list.h
+++ b/attribute_list.h
@@ -36,8 +36,6 @@
// Instantiates an NetlinkAttribute of the appropriate type from |id|,
// initializes it from |data|, and adds it to |attributes_|.
- // TODO(wdg): This is a stop-gap for use before message constructors add
- // their attributes as message templates.
bool CreateAndInitAttribute(int id, const nlattr *data,
AttributeList::NewFromIdMethod factory);
diff --git a/generic_netlink_message.cc b/generic_netlink_message.cc
index 39005cf..4e8adc7 100644
--- a/generic_netlink_message.cc
+++ b/generic_netlink_message.cc
@@ -116,8 +116,6 @@
for (int i = 0; i < CTRL_ATTR_MAX + 1; ++i) {
if (tb[i]) {
- // TODO(wdg): When NetlinkMessages instantiate their own attributes,
- // this call should, instead, call |SetAttributeFromNlAttr|.
attributes_->CreateAndInitAttribute(
i, tb[i], Bind(&NetlinkAttribute::NewControlAttributeFromId));
}
diff --git a/netlink_message_unittest.cc b/netlink_message_unittest.cc
index accca68..0c6933b 100644
--- a/netlink_message_unittest.cc
+++ b/netlink_message_unittest.cc
@@ -55,7 +55,7 @@
0xc0, 0x3f, 0x0e, 0x77, 0xe8, 0x7f
};
-const uint8_t kAssignedRespIeBytes[] = {
+const uint8_t kRespIeBytes[] = {
0x01, 0x08, 0x82, 0x84,
0x8b, 0x96, 0x0c, 0x12,
0x18, 0x24, 0x32, 0x04,
@@ -686,11 +686,12 @@
EXPECT_EQ(kExpectedConnectStatus, value);
}
- // TODO(wdg): Need to check the value of this attribute.
{
ByteString rawdata;
EXPECT_TRUE(message->const_attributes()->GetRawAttributeValue(
NL80211_ATTR_RESP_IE, &rawdata));
+ EXPECT_TRUE(rawdata.Equals(
+ ByteString(kRespIeBytes, arraysize(kRespIeBytes))));
}
}
@@ -724,7 +725,7 @@
EXPECT_TRUE(message.attributes()->CreateAttribute(NL80211_ATTR_RESP_IE,
Bind(&NetlinkAttribute::NewNl80211AttributeFromId)));
EXPECT_TRUE(message.attributes()->SetRawAttributeValue(NL80211_ATTR_RESP_IE,
- ByteString(kAssignedRespIeBytes, arraysize(kAssignedRespIeBytes))));
+ ByteString(kRespIeBytes, arraysize(kRespIeBytes))));
// Encode the message to a ByteString and remove all the run-specific
// values.
diff --git a/nl80211_message.cc b/nl80211_message.cc
index 8693c46..b87acc0 100644
--- a/nl80211_message.cc
+++ b/nl80211_message.cc
@@ -98,8 +98,6 @@
for (int i = 0; i < NL80211_ATTR_MAX + 1; ++i) {
if (tb[i]) {
- // TODO(wdg): When Nl80211Messages instantiate their own attributes,
- // this call should, instead, call |SetAttributeFromNlAttr|.
attributes_->CreateAndInitAttribute(
i, tb[i], Bind(&NetlinkAttribute::NewNl80211AttributeFromId));
}
diff --git a/shill_unittest.cc b/shill_unittest.cc
index 19eb37d..b71bb69 100644
--- a/shill_unittest.cc
+++ b/shill_unittest.cc
@@ -323,8 +323,6 @@
// Run Daemon::Quit() after the daemon starts running.
dispatcher_->PostTask(Bind(&Daemon::Quit, Unretained(&daemon_)));
- // TODO(wdg): crbug.com/224712 - Need fix for "GLib-WARNING **: Invalid file
- // descriptor". This requires support for netlink_manager interface tests.
daemon_.Run();
ResetNetlinkManager();
}