[clang] a60ef98 - ClangDriverTests:ToolChainTest.cpp: Fix warnings. [-Wsign-compare]
NAKAMURA Takumi via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 30 01:23:31 PDT 2022
Author: NAKAMURA Takumi
Date: 2022-04-30T17:19:26+09:00
New Revision: a60ef98bb11378b24045372a53c55923df13ddc3
URL: https://github.com/llvm/llvm-project/commit/a60ef98bb11378b24045372a53c55923df13ddc3
DIFF: https://github.com/llvm/llvm-project/commit/a60ef98bb11378b24045372a53c55923df13ddc3.diff
LOG: ClangDriverTests:ToolChainTest.cpp: Fix warnings. [-Wsign-compare]
EXPECT_EQ(num,num) is aware of signedness, even if rhs is a constant.
Added:
Modified:
clang/unittests/Driver/ToolChainTest.cpp
Removed:
################################################################################
diff --git a/clang/unittests/Driver/ToolChainTest.cpp b/clang/unittests/Driver/ToolChainTest.cpp
index 7abcb3ee0d975..c652b093dc993 100644
--- a/clang/unittests/Driver/ToolChainTest.cpp
+++ b/clang/unittests/Driver/ToolChainTest.cpp
@@ -544,7 +544,7 @@ TEST(DxcModeTest, ValidatorVersionValidation) {
if (A)
EXPECT_STREQ(A->getValue(), "1.1");
}
- EXPECT_EQ(Diags.getNumErrors(), 0);
+ EXPECT_EQ(Diags.getNumErrors(), 0u);
// Invalid tests.
Args = TheDriver.ParseArgStrings({"-validator-version", "0.1"}, false,
@@ -555,7 +555,7 @@ TEST(DxcModeTest, ValidatorVersionValidation) {
DAL->append(A);
TranslatedArgs = TC.TranslateArgs(*DAL, "0", Action::OffloadKind::OFK_None);
- EXPECT_EQ(Diags.getNumErrors(), 1);
+ EXPECT_EQ(Diags.getNumErrors(), 1u);
EXPECT_STREQ(DiagConsumer->Errors.back().c_str(),
"invalid validator version : 0.1\nIf validator major version is "
"0, minor version must also be 0.");
@@ -570,7 +570,7 @@ TEST(DxcModeTest, ValidatorVersionValidation) {
DAL->append(A);
TranslatedArgs = TC.TranslateArgs(*DAL, "0", Action::OffloadKind::OFK_None);
- EXPECT_EQ(Diags.getNumErrors(), 2);
+ EXPECT_EQ(Diags.getNumErrors(), 2u);
EXPECT_STREQ(DiagConsumer->Errors.back().c_str(),
"invalid validator version : 1\nFormat of validator version is "
"\"<major>.<minor>\" (ex:\"1.4\").");
@@ -585,7 +585,7 @@ TEST(DxcModeTest, ValidatorVersionValidation) {
DAL->append(A);
TranslatedArgs = TC.TranslateArgs(*DAL, "0", Action::OffloadKind::OFK_None);
- EXPECT_EQ(Diags.getNumErrors(), 3);
+ EXPECT_EQ(Diags.getNumErrors(), 3u);
EXPECT_STREQ(
DiagConsumer->Errors.back().c_str(),
"invalid validator version : -Tlib_6_7\nFormat of validator version is "
@@ -601,7 +601,7 @@ TEST(DxcModeTest, ValidatorVersionValidation) {
DAL->append(A);
TranslatedArgs = TC.TranslateArgs(*DAL, "0", Action::OffloadKind::OFK_None);
- EXPECT_EQ(Diags.getNumErrors(), 4);
+ EXPECT_EQ(Diags.getNumErrors(), 4u);
EXPECT_STREQ(
DiagConsumer->Errors.back().c_str(),
"invalid validator version : foo\nFormat of validator version is "
More information about the cfe-commits
mailing list