Skip to content

Commit

Permalink
Rename unittests/ADT/ilistTestTemp.cpp => IListTest.cpp
Browse files Browse the repository at this point in the history
And rename the tests inside from ilistTest to IListTest.  This makes the
file sort properly in the CMakeLists.txt (previously, sorting would
throw it down to the end of the list) and is consistent with the tests
I've added more recently.

Why use IListNodeBaseTest.cpp (and a test name of IListNodeBaseTest)?
- ilist_node_base_test is the obvious thing, since this is testing
  ilist_node_base.  However, gtest disallows underscores in test names.
- ilist_node_baseTest fails for the same reason.
- ilistNodeBaseTest is weird, because it isn't in our usual
  TitleCaseTest form that we use for tests, and it also doesn't have the
  name of the tested class in it.
- IlistNodeBaseTest matches TitleCaseTest, but "Ilist" is hard to read,
  and really "ilist" is an abbreviation for "IntrusiveList" so the
  lowercase "list" is strange.
- That left IListNodeBaseTest.

Note: I made this move in two stages, with a temporary filename of
ilistTestTemp in between in r279524.  This was in the hopes of avoiding
problems on Git and SVN clients on case-insensitive filesystems,
particularly on buildbots with incremental checkouts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280033 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dexonsmith committed Aug 30, 2016
1 parent 1d79fff commit ba63e29
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion unittests/ADT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ set(ADTSources
FoldingSet.cpp
FunctionRefTest.cpp
HashingTest.cpp
ilistTestTemp.cpp
IListBaseTest.cpp
IListIteratorTest.cpp
IListNodeBaseTest.cpp
IListSentinelTest.cpp
IListTest.cpp
ImmutableMapTest.cpp
ImmutableSetTest.cpp
IntEqClassesTest.cpp
Expand Down
25 changes: 11 additions & 14 deletions unittests/ADT/ilistTestTemp.cpp → unittests/ADT/IListTest.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- unittests/ADT/ilistTestTemp.cpp - ilist unit tests -----------------===//
//===- unittests/ADT/IListTest.cpp - ilist unit tests ---------------------===//
//
// The LLVM Compiler Infrastructure
//
Expand All @@ -7,9 +7,6 @@
//
//===----------------------------------------------------------------------===//

// 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"
Expand All @@ -29,7 +26,7 @@ struct Node : ilist_node<Node> {
~Node() { Value = -1; }
};

TEST(ilistTest, Basic) {
TEST(IListTest, Basic) {
ilist<Node> List;
List.push_back(Node(1));
EXPECT_EQ(1, List.back().Value);
Expand All @@ -47,7 +44,7 @@ TEST(ilistTest, Basic) {
EXPECT_EQ(1, ConstList.getPrevNode(ConstList.back())->Value);
}

TEST(ilistTest, SpliceOne) {
TEST(IListTest, SpliceOne) {
ilist<Node> List;
List.push_back(1);

Expand All @@ -67,7 +64,7 @@ TEST(ilistTest, SpliceOne) {
EXPECT_EQ(3, List.back().Value);
}

TEST(ilistTest, SpliceSwap) {
TEST(IListTest, SpliceSwap) {
ilist<Node> L;
Node N0(0);
Node N1(1);
Expand All @@ -83,7 +80,7 @@ TEST(ilistTest, SpliceSwap) {
L.clearAndLeakNodesUnsafely();
}

TEST(ilistTest, SpliceSwapOtherWay) {
TEST(IListTest, SpliceSwapOtherWay) {
ilist<Node> L;
Node N0(0);
Node N1(1);
Expand All @@ -99,7 +96,7 @@ TEST(ilistTest, SpliceSwapOtherWay) {
L.clearAndLeakNodesUnsafely();
}

TEST(ilistTest, UnsafeClear) {
TEST(IListTest, UnsafeClear) {
ilist<Node> List;

// Before even allocating a sentinel.
Expand Down Expand Up @@ -132,7 +129,7 @@ TEST(ilistTest, UnsafeClear) {
}

struct Empty {};
TEST(ilistTest, HasObsoleteCustomizationTrait) {
TEST(IListTest, HasObsoleteCustomizationTrait) {
// Negative test for HasObsoleteCustomization.
static_assert(!ilist_detail::HasObsoleteCustomization<Empty, Node>::value,
"Empty has no customizations");
Expand All @@ -141,7 +138,7 @@ TEST(ilistTest, HasObsoleteCustomizationTrait) {
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,
Expand All @@ -155,7 +152,7 @@ TEST(ilistTest, HasGetNextTrait) {
struct CreateSentinel {
Node *createSentinel();
};
TEST(ilistTest, HasCreateSentinelTrait) {
TEST(IListTest, HasCreateSentinelTrait) {
static_assert(ilist_detail::HasCreateSentinel<CreateSentinel>::value,
"CreateSentinel has a getNext(Node*)");
static_assert(
Expand Down Expand Up @@ -189,7 +186,7 @@ struct ilist_traits<NodeWithCallback>

namespace {

TEST(ilistTest, addNodeToList) {
TEST(IListTest, addNodeToList) {
ilist<NodeWithCallback> L;
NodeWithCallback N(7);
ASSERT_FALSE(N.IsInList);
Expand All @@ -214,7 +211,7 @@ struct PrivateNode : private ilist_node<PrivateNode> {
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;
Expand Down

0 comments on commit ba63e29

Please sign in to comment.