Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(782)

Unified Diff: unit_test/compare_test.cc

Issue 2414763002: Cast for clang-cl 64 bit build warnings in unittests (Closed)
Patch Set: bump version Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/libyuv/version.h ('k') | unit_test/convert_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unit_test/compare_test.cc
diff --git a/unit_test/compare_test.cc b/unit_test/compare_test.cc
index a8ce671d693e4233068e1c1d951213a2dfdfe13f..ecdc8cac4fe4ed9d10619ce72f99e38e843eb491 100644
--- a/unit_test/compare_test.cc
+++ b/unit_test/compare_test.cc
@@ -157,19 +157,19 @@ TEST_F(LibYUVBaseTest, BenchmarkARGBDetect_Opt) {
src_a[0] = 0;
fourcc = ARGBDetect(src_a, benchmark_width_ * 4,
benchmark_width_, benchmark_height_);
- EXPECT_EQ(libyuv::FOURCC_BGRA, fourcc);
+ EXPECT_EQ(static_cast<uint32>(libyuv::FOURCC_BGRA), fourcc);
src_a[0] = 255;
src_a[3] = 0;
fourcc = ARGBDetect(src_a, benchmark_width_ * 4,
benchmark_width_, benchmark_height_);
- EXPECT_EQ(libyuv::FOURCC_ARGB, fourcc);
+ EXPECT_EQ(static_cast<uint32>(libyuv::FOURCC_ARGB), fourcc);
src_a[3] = 255;
for (int i = 0; i < benchmark_iterations_; ++i) {
fourcc = ARGBDetect(src_a, benchmark_width_ * 4,
benchmark_width_, benchmark_height_);
}
- EXPECT_EQ(0, fourcc);
+ EXPECT_EQ(0u, fourcc);
free_aligned_buffer_page_end(src_a);
}
@@ -185,19 +185,19 @@ TEST_F(LibYUVBaseTest, BenchmarkARGBDetect_Unaligned) {
src_a[0 + 1] = 0;
fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4,
benchmark_width_, benchmark_height_);
- EXPECT_EQ(libyuv::FOURCC_BGRA, fourcc);
+ EXPECT_EQ(static_cast<uint32>(libyuv::FOURCC_BGRA), fourcc);
src_a[0 + 1] = 255;
src_a[3 + 1] = 0;
fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4,
benchmark_width_, benchmark_height_);
- EXPECT_EQ(libyuv::FOURCC_ARGB, fourcc);
+ EXPECT_EQ(static_cast<uint32>(libyuv::FOURCC_ARGB), fourcc);
src_a[3 + 1] = 255;
for (int i = 0; i < benchmark_iterations_; ++i) {
fourcc = ARGBDetect(src_a + 1, benchmark_width_ * 4,
benchmark_width_, benchmark_height_);
}
- EXPECT_EQ(0, fourcc);
+ EXPECT_EQ(0u, fourcc);
free_aligned_buffer_page_end(src_a);
}
@@ -226,7 +226,7 @@ TEST_F(LibYUVBaseTest, BenchmarkSumSquareError_Opt) {
h1 = ComputeSumSquareError(src_a, src_b, kMaxWidth);
}
- EXPECT_EQ(0, h1);
+ EXPECT_EQ(0u, h1);
free_aligned_buffer_page_end(src_a);
free_aligned_buffer_page_end(src_b);
@@ -242,18 +242,18 @@ TEST_F(LibYUVBaseTest, SumSquareError) {
uint64 err;
err = ComputeSumSquareError(src_a, src_b, kMaxWidth);
- EXPECT_EQ(0, err);
+ EXPECT_EQ(0u, err);
memset(src_a, 1, kMaxWidth);
err = ComputeSumSquareError(src_a, src_b, kMaxWidth);
- EXPECT_EQ(err, kMaxWidth);
+ EXPECT_EQ(static_cast<int>(err), kMaxWidth);
memset(src_a, 190, kMaxWidth);
memset(src_b, 193, kMaxWidth);
err = ComputeSumSquareError(src_a, src_b, kMaxWidth);
- EXPECT_EQ(kMaxWidth * 3 * 3, err);
+ EXPECT_EQ(static_cast<int>(err), kMaxWidth * 3 * 3);
for (int i = 0; i < kMaxWidth; ++i) {
src_a[i] = (fastrand() & 0xff);
« no previous file with comments | « include/libyuv/version.h ('k') | unit_test/convert_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698