From 104dbbbfd9f82cfa08ec4ad1da649441db4e6306 Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 18 Jul 2013 16:13:39 -0700 Subject: [PATCH] tests: silence a few type related warnings Change-Id: If908328c1dbbb5bd84c57e30fab1cda1804933e4 --- test/ivf_video_source.h | 3 ++- test/subtract_test.cc | 2 +- test/util.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/ivf_video_source.h b/test/ivf_video_source.h index 88bc597ae..926f801d4 100644 --- a/test/ivf_video_source.h +++ b/test/ivf_video_source.h @@ -47,7 +47,8 @@ class IVFVideoSource : public CompressedVideoSource { virtual void Init() { // Allocate a buffer for read in the compressed video frame. compressed_frame_buf_ = new uint8_t[libvpx_test::kCodeBufferSize]; - ASSERT_TRUE(compressed_frame_buf_) << "Allocate frame buffer failed"; + ASSERT_TRUE(compressed_frame_buf_ != NULL) + << "Allocate frame buffer failed"; } virtual void Begin() { diff --git a/test/subtract_test.cc b/test/subtract_test.cc index 81bfb662c..574bfbf47 100644 --- a/test/subtract_test.cc +++ b/test/subtract_test.cc @@ -61,7 +61,7 @@ TEST_P(SubtractBlockTest, SimpleSubtract) { int16_t *src_diff = be.src_diff; for (int r = 0; r < kBlockHeight; ++r) { for (int c = 0; c < kBlockWidth; ++c) { - src_diff[c] = 0xa5a5; + src_diff[c] = static_cast(0xa5a5); } src_diff += kDiffPredStride; } diff --git a/test/util.h b/test/util.h index 533a1db5c..4d7f3d41e 100644 --- a/test/util.h +++ b/test/util.h @@ -37,7 +37,7 @@ static double compute_psnr(const vpx_image_t *img1, img2->planes[VPX_PLANE_Y][i * img2->stride[VPX_PLANE_Y] + j]; sqrerr += d * d; } - double mse = sqrerr / (width_y * height_y); + double mse = static_cast(sqrerr) / (width_y * height_y); double psnr = 100.0; if (mse > 0.0) { psnr = 10 * log10(255.0 * 255.0 / mse); -- 2.40.0