[lld] r205369 - Simplify InputGraphTest.

Rui Ueyama ruiu at google.com
Tue Apr 1 15:42:38 PDT 2014


Author: ruiu
Date: Tue Apr  1 17:42:38 2014
New Revision: 205369

URL: http://llvm.org/viewvc/llvm-project?rev=205369&view=rev
Log:
Simplify InputGraphTest.

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=205369&r1=205368&r2=205369&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/InputGraphTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/InputGraphTest.cpp Tue Apr  1 17:42:38 2014
@@ -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<FileNode>(*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, AddAFileWithLLDFi
   EXPECT_EQ(InputElement::Kind::File, (*nextElement)->kind());
   FileNode *fileNode = llvm::dyn_cast<FileNode>(*nextElement);
 
-  StringRef path = fileNode->getUserPath();
-  EXPECT_EQ(0, path.compare("multi_files"));
+  EXPECT_EQ("multi_files", fileNode->getUserPath());
 
   ErrorOr<File &> objfile = fileNode->getNextFile();
   EXPECT_NE(InputGraphError::no_more_files, objfile.getError());
@@ -222,8 +220,7 @@ TEST_F(InputGraphTest, AddNodeWithFilesA
   EXPECT_EQ(InputElement::Kind::File, (*nextElement)->kind());
   FileNode *fileNode = llvm::dyn_cast<FileNode>(*nextElement);
 
-  StringRef path = fileNode->getUserPath();
-  EXPECT_EQ(0, path.compare("multi_files1"));
+  EXPECT_EQ("multi_files1", fileNode->getUserPath());
 
   ErrorOr<File &> objfile = fileNode->getNextFile();
   EXPECT_NE(InputGraphError::no_more_files, objfile.getError());
@@ -312,8 +309,7 @@ TEST_F(InputGraphTest, AddNodeWithGroupI
   EXPECT_EQ(InputElement::Kind::File, (*nextElement)->kind());
   FileNode *fileNode = llvm::dyn_cast<FileNode>(*nextElement);
 
-  StringRef path = fileNode->getUserPath();
-  EXPECT_EQ(0, path.compare("multi_files1"));
+  EXPECT_EQ("multi_files1", fileNode->getUserPath());
 
   ErrorOr<File &> objfile = fileNode->getNextFile();
   EXPECT_NE(InputGraphError::no_more_files, objfile.getError());





More information about the llvm-commits mailing list