[llvm] a0540e6 - unittests: Use EXPECT_ instead of ASSERT_ in a few tests (#129251)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 1 18:29:59 PST 2025


Author: Matt Arsenault
Date: 2025-03-02T09:29:56+07:00
New Revision: a0540e6c98972954f42d3b72d70976d8286113ea

URL: https://github.com/llvm/llvm-project/commit/a0540e6c98972954f42d3b72d70976d8286113ea
DIFF: https://github.com/llvm/llvm-project/commit/a0540e6c98972954f42d3b72d70976d8286113ea.diff

LOG: unittests: Use EXPECT_ instead of ASSERT_ in a few tests (#129251)

Added: 
    

Modified: 
    llvm/unittests/Support/ProgramTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/ProgramTest.cpp b/llvm/unittests/Support/ProgramTest.cpp
index b1b35eacd1f61..47d2e269afe94 100644
--- a/llvm/unittests/Support/ProgramTest.cpp
+++ b/llvm/unittests/Support/ProgramTest.cpp
@@ -422,10 +422,10 @@ TEST(ProgramTest, TestExecuteNegative) {
     bool ExecutionFailed;
     int RetCode = ExecuteAndWait(Executable, argv, std::nullopt, {}, 0, 0,
                                  &Error, &ExecutionFailed);
-    ASSERT_LT(RetCode, 0) << "On error ExecuteAndWait should return 0 or "
+    EXPECT_LT(RetCode, 0) << "On error ExecuteAndWait should return 0 or "
                              "positive value indicating the result code";
-    ASSERT_TRUE(ExecutionFailed);
-    ASSERT_FALSE(Error.empty());
+    EXPECT_TRUE(ExecutionFailed);
+    EXPECT_FALSE(Error.empty());
   }
 
   {
@@ -433,10 +433,10 @@ TEST(ProgramTest, TestExecuteNegative) {
     bool ExecutionFailed;
     ProcessInfo PI = ExecuteNoWait(Executable, argv, std::nullopt, {}, 0,
                                    &Error, &ExecutionFailed);
-    ASSERT_EQ(PI.Pid, ProcessInfo::InvalidPid)
+    EXPECT_EQ(PI.Pid, ProcessInfo::InvalidPid)
         << "On error ExecuteNoWait should return an invalid ProcessInfo";
-    ASSERT_TRUE(ExecutionFailed);
-    ASSERT_FALSE(Error.empty());
+    EXPECT_TRUE(ExecutionFailed);
+    EXPECT_FALSE(Error.empty());
   }
 
 }


        


More information about the llvm-commits mailing list