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

Side by Side Diff: webrtc/base/safe_compare_unittest.cc

Issue 2534683002: RTC_[D]CHECK_op: Remove superfluous casts (Closed)
Patch Set: test Created 4 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 EXPECT_TRUE(safe_cmp::Ge(2, 2.0)); 369 EXPECT_TRUE(safe_cmp::Ge(2, 2.0));
370 EXPECT_TRUE(safe_cmp::Ge(2.0, 2)); 370 EXPECT_TRUE(safe_cmp::Ge(2.0, 2));
371 EXPECT_TRUE(safe_cmp::Ge(2.0, 2.0)); 371 EXPECT_TRUE(safe_cmp::Ge(2.0, 2.0));
372 372
373 EXPECT_TRUE(safe_cmp::Ge(p1, p1)); 373 EXPECT_TRUE(safe_cmp::Ge(p1, p1));
374 EXPECT_FALSE(safe_cmp::Ge(p1, p2)); 374 EXPECT_FALSE(safe_cmp::Ge(p1, p2));
375 EXPECT_TRUE(safe_cmp::Ge(p2, p1)); 375 EXPECT_TRUE(safe_cmp::Ge(p2, p1));
376 EXPECT_TRUE(safe_cmp::Ge(p2, p2)); 376 EXPECT_TRUE(safe_cmp::Ge(p2, p2));
377 } 377 }
378 378
379 TEST(SafeCmpTest, Enum) {
380 enum E1 { e1 = 13 };
381 enum { e2 = 13 };
382 enum E3 : unsigned { e3 = 13 };
383 enum : unsigned { e4 = 13 };
384 EXPECT_TRUE(safe_cmp::Eq(13, e1));
385 EXPECT_TRUE(safe_cmp::Eq(13u, e1));
386 EXPECT_TRUE(safe_cmp::Eq(13, e2));
387 EXPECT_TRUE(safe_cmp::Eq(13u, e2));
388 EXPECT_TRUE(safe_cmp::Eq(13, e3));
389 EXPECT_TRUE(safe_cmp::Eq(13u, e3));
390 EXPECT_TRUE(safe_cmp::Eq(13, e4));
391 EXPECT_TRUE(safe_cmp::Eq(13u, e4));
392 }
393
379 } // namespace rtc 394 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698