From 29383c8b039b530219770cbb676b01c5fcb3519d Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Tue, 27 Feb 2018 10:45:24 -0800 Subject: [PATCH] switch to static_assert for clang-tidy Bug: None Test: try bots and lint pass Change-Id: I7429b394c89450c13732205dae672793e4bb6f44 Reviewed-on: https://chromium-review.googlesource.com/939844 Reviewed-by: Noah Richards Commit-Queue: Frank Barchard --- README.chromium | 2 +- include/libyuv/version.h | 2 +- unit_test/convert_test.cc | 16 ++++++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.chromium b/README.chromium index a65b8e12b..c25373e23 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1702 +Version: 1703 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 6ac39820f..21522cf35 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1702 +#define LIBYUV_VERSION 1703 #endif // INCLUDE_LIBYUV_VERSION_H_ diff --git a/unit_test/convert_test.cc b/unit_test/convert_test.cc index 92dbd1478..abfe7bcfd 100644 --- a/unit_test/convert_test.cc +++ b/unit_test/convert_test.cc @@ -51,12 +51,16 @@ namespace libyuv { SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, \ DST_SUBSAMP_X, DST_SUBSAMP_Y, W1280, N, NEG, OFF) \ TEST_F(LibYUVConvertTest, SRC_FMT_PLANAR##To##FMT_PLANAR##N) { \ - assert(SRC_BPC == 1 || SRC_BPC == 2); \ - assert(DST_BPC == 1 || DST_BPC == 2); \ - assert(SRC_SUBSAMP_X == 1 || SRC_SUBSAMP_X == 2); \ - assert(SRC_SUBSAMP_Y == 1 || SRC_SUBSAMP_Y == 2); \ - assert(DST_SUBSAMP_X == 1 || DST_SUBSAMP_X == 2); \ - assert(DST_SUBSAMP_Y == 1 || DST_SUBSAMP_Y == 2); \ + static_assert(SRC_BPC == 1 || SRC_BPC == 2, "SRC BPC unsupported"); \ + static_assert(DST_BPC == 1 || DST_BPC == 2, "DST BPC unsupported"); \ + static_assert(SRC_SUBSAMP_X == 1 || SRC_SUBSAMP_X == 2, \ + "DST SRC_SUBSAMP_X unsupported"); \ + static_assert(SRC_SUBSAMP_Y == 1 || SRC_SUBSAMP_Y == 2, \ + "DST SRC_SUBSAMP_Y unsupported"); \ + static_assert(DST_SUBSAMP_X == 1 || DST_SUBSAMP_X == 2, \ + "DST DST_SUBSAMP_X unsupported"); \ + static_assert(DST_SUBSAMP_Y == 1 || DST_SUBSAMP_Y == 2, \ + "DST DST_SUBSAMP_Y unsupported"); \ const int kWidth = ((W1280) > 0) ? (W1280) : 1; \ const int kHeight = benchmark_height_; \ const int kSrcHalfWidth = SUBSAMPLE(kWidth, SRC_SUBSAMP_X); \