From 04afaeff521287c133b1b4a84c38ad3945936fdc Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 1 Apr 2014 22:42:38 +0000 Subject: [PATCH] Simplify InputGraphTest. llvm-svn: 205369 --- lld/unittests/DriverTests/InputGraphTest.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lld/unittests/DriverTests/InputGraphTest.cpp b/lld/unittests/DriverTests/InputGraphTest.cpp index ebec345..2ea9a59 100644 --- a/lld/unittests/DriverTests/InputGraphTest.cpp +++ b/lld/unittests/DriverTests/InputGraphTest.cpp @@ -126,8 +126,7 @@ TEST_F(InputGraphTest, AddAFile) { EXPECT_NE(InputGraphError::no_more_elements, nextElement.getError()); EXPECT_EQ(InputElement::Kind::File, (*nextElement)->kind()); FileNode *fileNode = llvm::dyn_cast(*nextElement); - StringRef path = fileNode->getUserPath(); - EXPECT_EQ(0, path.compare("file1")); + EXPECT_EQ("file1", fileNode->getUserPath()); nextElement = inputGraph().getNextInputElement(); EXPECT_EQ(InputGraphError::no_more_elements, nextElement.getError()); } @@ -147,8 +146,7 @@ TEST_F(InputGraphTest, AddAFileWithLLDFiles) { EXPECT_EQ(InputElement::Kind::File, (*nextElement)->kind()); FileNode *fileNode = llvm::dyn_cast(*nextElement); - StringRef path = fileNode->getUserPath(); - EXPECT_EQ(0, path.compare("multi_files")); + EXPECT_EQ("multi_files", fileNode->getUserPath()); ErrorOr objfile = fileNode->getNextFile(); EXPECT_NE(InputGraphError::no_more_files, objfile.getError()); @@ -222,8 +220,7 @@ TEST_F(InputGraphTest, AddNodeWithFilesAndGroup) { EXPECT_EQ(InputElement::Kind::File, (*nextElement)->kind()); FileNode *fileNode = llvm::dyn_cast(*nextElement); - StringRef path = fileNode->getUserPath(); - EXPECT_EQ(0, path.compare("multi_files1")); + EXPECT_EQ("multi_files1", fileNode->getUserPath()); ErrorOr objfile = fileNode->getNextFile(); EXPECT_NE(InputGraphError::no_more_files, objfile.getError()); @@ -312,8 +309,7 @@ TEST_F(InputGraphTest, AddNodeWithGroupIteration) { EXPECT_EQ(InputElement::Kind::File, (*nextElement)->kind()); FileNode *fileNode = llvm::dyn_cast(*nextElement); - StringRef path = fileNode->getUserPath(); - EXPECT_EQ(0, path.compare("multi_files1")); + EXPECT_EQ("multi_files1", fileNode->getUserPath()); ErrorOr objfile = fileNode->getNextFile(); EXPECT_NE(InputGraphError::no_more_files, objfile.getError()); -- 2.7.4