-
Notifications
You must be signed in to change notification settings - Fork 14.3k
unittests: Use EXPECT_ instead of ASSERT_ in a few tests #129251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
arsenm
merged 1 commit into
main
from
users/arsenm/support/gtest-use-expect-instead-of-assert
Mar 2, 2025
Merged
unittests: Use EXPECT_ instead of ASSERT_ in a few tests #129251
arsenm
merged 1 commit into
main
from
users/arsenm/support/gtest-use-expect-instead-of-assert
Mar 2, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-llvm-support Author: Matt Arsenault (arsenm) ChangesFull diff: https://github.com/llvm/llvm-project/pull/129251.diff 1 Files Affected:
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());
}
}
|
MaskRay
approved these changes
Mar 1, 2025
d336a1f
to
aca6e94
Compare
Base automatically changed from
users/arsenm/issue129208/llvm-rc-relax-test-error-message
to
main
March 2, 2025 02:26
47533d0
to
bc18c29
Compare
jph-13
pushed a commit
to jph-13/llvm-project
that referenced
this pull request
Mar 21, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.