[lld] r208116 - Simplify unit test code.
Rui Ueyama
ruiu at google.com
Tue May 6 11:41:12 PDT 2014
Author: ruiu
Date: Tue May 6 13:41:12 2014
New Revision: 208116
URL: http://llvm.org/viewvc/llvm-project?rev=208116&view=rev
Log:
Simplify unit test code.
Modified:
lld/trunk/unittests/DriverTests/InputGraphTest.cpp
Modified: lld/trunk/unittests/DriverTests/InputGraphTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/InputGraphTest.cpp?rev=208116&r1=208115&r2=208116&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/InputGraphTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/InputGraphTest.cpp Tue May 6 13:41:12 2014
@@ -142,16 +142,9 @@ TEST_F(InputGraphTest, AddNodeWithFilesA
// an file node which looks like an archive and
// two file nodes
std::unique_ptr<Group> mygroup(new Group());
- std::unique_ptr<MyFileNode> myarchive = createFile2("objfile_1", "objfile_2");
- EXPECT_EQ(true, mygroup->addFile(std::move(myarchive)));
-
- std::unique_ptr<MyFileNode> mygroupobjfile_1 = createFile1("group_objfile1");
- EXPECT_EQ(true, mygroup->addFile(std::move(mygroupobjfile_1)));
-
- std::unique_ptr<MyFileNode> mygroupobjfile_2 = createFile1("group_objfile2");
- EXPECT_EQ(true, mygroup->addFile(std::move(mygroupobjfile_2)));
-
- // Add the group to the InputGraph.
+ mygroup->addFile(createFile2("objfile_1", "objfile_2"));
+ mygroup->addFile(createFile1("group_objfile1"));
+ mygroup->addFile(createFile1("group_objfile2"));
getInputGraph().addInputElement(std::move(mygroup));
EXPECT_EQ(2, inputFileCount());
@@ -204,16 +197,9 @@ TEST_F(InputGraphTest, AddNodeWithGroupI
// an file node which looks like an archive and
// two file nodes
std::unique_ptr<Group> mygroup(new Group());
- std::unique_ptr<MyFileNode> myarchive = createFile2("objfile_1", "objfile_2");
- EXPECT_EQ(true, mygroup->addFile(std::move(myarchive)));
-
- std::unique_ptr<MyFileNode> mygroupobjfile_1 = createFile1("group_objfile1");
- EXPECT_EQ(true, mygroup->addFile(std::move(mygroupobjfile_1)));
-
- std::unique_ptr<MyFileNode> mygroupobjfile_2 = createFile1("group_objfile2");
- EXPECT_EQ(true, mygroup->addFile(std::move(mygroupobjfile_2)));
-
- // Add the group to the InputGraph.
+ mygroup->addFile(createFile2("objfile_1", "objfile_2"));
+ mygroup->addFile(createFile1("group_objfile1"));
+ mygroup->addFile(createFile1("group_objfile2"));
getInputGraph().addInputElement(std::move(mygroup));
EXPECT_EQ(2, inputFileCount());
More information about the llvm-commits
mailing list