-//===- unittests/ADT/ilistTestTemp.cpp - ilist unit tests -----------------===//
+//===- unittests/ADT/IListTest.cpp - ilist unit tests ---------------------===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
-// FIXME: Rename this file to IListTest.cpp once incremental checkouts on bots
-// have found this file.
-
#include "llvm/ADT/ilist.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ilist_node.h"
~Node() { Value = -1; }
};
-TEST(ilistTest, Basic) {
+TEST(IListTest, Basic) {
ilist<Node> List;
List.push_back(Node(1));
EXPECT_EQ(1, List.back().Value);
EXPECT_EQ(1, ConstList.getPrevNode(ConstList.back())->Value);
}
-TEST(ilistTest, SpliceOne) {
+TEST(IListTest, SpliceOne) {
ilist<Node> List;
List.push_back(1);
EXPECT_EQ(3, List.back().Value);
}
-TEST(ilistTest, SpliceSwap) {
+TEST(IListTest, SpliceSwap) {
ilist<Node> L;
Node N0(0);
Node N1(1);
L.clearAndLeakNodesUnsafely();
}
-TEST(ilistTest, SpliceSwapOtherWay) {
+TEST(IListTest, SpliceSwapOtherWay) {
ilist<Node> L;
Node N0(0);
Node N1(1);
L.clearAndLeakNodesUnsafely();
}
-TEST(ilistTest, UnsafeClear) {
+TEST(IListTest, UnsafeClear) {
ilist<Node> List;
// Before even allocating a sentinel.
}
struct Empty {};
-TEST(ilistTest, HasObsoleteCustomizationTrait) {
+TEST(IListTest, HasObsoleteCustomizationTrait) {
// Negative test for HasObsoleteCustomization.
static_assert(!ilist_detail::HasObsoleteCustomization<Empty, Node>::value,
"Empty has no customizations");
struct GetNext {
Node *getNext(Node *);
};
-TEST(ilistTest, HasGetNextTrait) {
+TEST(IListTest, HasGetNextTrait) {
static_assert(ilist_detail::HasGetNext<GetNext, Node>::value,
"GetNext has a getNext(Node*)");
static_assert(ilist_detail::HasObsoleteCustomization<GetNext, Node>::value,
struct CreateSentinel {
Node *createSentinel();
};
-TEST(ilistTest, HasCreateSentinelTrait) {
+TEST(IListTest, HasCreateSentinelTrait) {
static_assert(ilist_detail::HasCreateSentinel<CreateSentinel>::value,
"CreateSentinel has a getNext(Node*)");
static_assert(
namespace {
-TEST(ilistTest, addNodeToList) {
+TEST(IListTest, addNodeToList) {
ilist<NodeWithCallback> L;
NodeWithCallback N(7);
ASSERT_FALSE(N.IsInList);
PrivateNode(const PrivateNode &) = delete;
};
-TEST(ilistTest, privateNode) {
+TEST(IListTest, privateNode) {
// Instantiate various APIs to be sure they're callable when ilist_node is
// inherited privately.
ilist<NodeWithCallback> L;