Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: base/linked_list_unittest.cc

Issue 266020: Use static_cast in LinkNode<T>::value() so that it works with... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/linked_list.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/linked_list_unittest.cc
===================================================================
--- base/linked_list_unittest.cc (revision 28382)
+++ base/linked_list_unittest.cc (working copy)
@@ -19,6 +19,18 @@
int id_;
};
+class MultipleInheritanceNodeBase {
+ public:
+ MultipleInheritanceNodeBase() : field_taking_up_space_(0) {}
+ int field_taking_up_space_;
+};
+
+class MultipleInheritanceNode : public MultipleInheritanceNodeBase,
+ public LinkNode<MultipleInheritanceNode> {
+ public:
+ MultipleInheritanceNode() {}
+};
+
// Checks that when iterating |list| (either from head to tail, or from
// tail to head, as determined by |forward|), we get back |node_ids|,
// which is an array of size |num_nodes|.
@@ -56,7 +68,6 @@
ExpectListContents(list, 0, NULL);
}
-
TEST(LinkedList, Append) {
LinkedList<Node> list;
ExpectListContents(list, 0, NULL);
@@ -241,5 +252,10 @@
}
}
+TEST(LinkedList, MultipleInheritanceNode) {
+ MultipleInheritanceNode node;
+ EXPECT_EQ(&node, node.value());
+}
+
} // namespace
} // namespace base
« no previous file with comments | « base/linked_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698