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

Unified Diff: webrtc/base/safe_minmax_unittest.cc

Issue 2916083003: SafeMin/SafeMax: Fix wrong return type when given two enum arguments (Closed)
Patch Set: Created 3 years, 7 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 | « webrtc/base/safe_minmax.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/safe_minmax_unittest.cc
diff --git a/webrtc/base/safe_minmax_unittest.cc b/webrtc/base/safe_minmax_unittest.cc
index 6fcbf00332970fc8002baf6dff072fa34d0fb8c2..519158b6ed78c1e04d377918cf32d2b990a21670 100644
--- a/webrtc/base/safe_minmax_unittest.cc
+++ b/webrtc/base/safe_minmax_unittest.cc
@@ -62,12 +62,19 @@ static_assert(TypeCheckMinMax<uint64_t, uint8_t, uint8_t, uint64_t>(), "");
static_assert(TypeCheckMinMax<uint64_t, int64_t, int64_t, uint64_t>(), "");
static_assert(TypeCheckMinMax<uint64_t, uint64_t, uint64_t, uint64_t>(), "");
-// SafeMin/SafeMax: Check that we can use enum types.
enum DefaultE { kFoo = -17 };
enum UInt8E : uint8_t { kBar = 17 };
-static_assert(TypeCheckMinMax<unsigned, DefaultE, int, unsigned>(), "");
-static_assert(TypeCheckMinMax<unsigned, UInt8E, uint8_t, unsigned>(), "");
-static_assert(TypeCheckMinMax<DefaultE, UInt8E, int, int>(), "");
+
+// SafeMin/SafeMax: Check that we can use enum types.
+static_assert(TypeCheckMinMax<unsigned, unsigned, unsigned, unsigned>(), "");
+static_assert(TypeCheckMinMax<unsigned, DefaultE, int, unsigned>(), "");
+static_assert(TypeCheckMinMax<unsigned, UInt8E, uint8_t, unsigned>(), "");
+static_assert(TypeCheckMinMax<DefaultE, unsigned, int, unsigned>(), "");
+static_assert(TypeCheckMinMax<DefaultE, DefaultE, int, int>(), "");
+static_assert(TypeCheckMinMax<DefaultE, UInt8E, int, int>(), "");
kwiberg-webrtc 2017/06/02 10:14:03 This (line 74) is the test that failed without the
+static_assert(TypeCheckMinMax< UInt8E, unsigned, uint8_t, unsigned>(), "");
+static_assert(TypeCheckMinMax< UInt8E, DefaultE, int, int>(), "");
+static_assert(TypeCheckMinMax< UInt8E, UInt8E, uint8_t, uint8_t>(), "");
using ld = long double;
« no previous file with comments | « webrtc/base/safe_minmax.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698