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

Unified Diff: webrtc/base/basictypes_unittest.cc

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 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 | « webrtc/base/bandwidthsmoother.cc ('k') | webrtc/base/bitbuffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/basictypes_unittest.cc
diff --git a/webrtc/base/basictypes_unittest.cc b/webrtc/base/basictypes_unittest.cc
index 4e243fdcae3584d87bd19f029ee806ae74c77387..df5ed5e7e5b4a56aec1e3e336c071f9745329944 100644
--- a/webrtc/base/basictypes_unittest.cc
+++ b/webrtc/base/basictypes_unittest.cc
@@ -14,18 +14,9 @@
namespace rtc {
-static_assert(sizeof(int8) == 1, "Unexpected size");
-static_assert(sizeof(uint8) == 1, "Unexpected size");
-static_assert(sizeof(int16) == 2, "Unexpected size");
-static_assert(sizeof(uint16) == 2, "Unexpected size");
-static_assert(sizeof(int32) == 4, "Unexpected size");
-static_assert(sizeof(uint32) == 4, "Unexpected size");
-static_assert(sizeof(int64) == 8, "Unexpected size");
-static_assert(sizeof(uint64) == 8, "Unexpected size");
-
TEST(BasicTypesTest, Endian) {
- uint16 v16 = 0x1234u;
- uint8 first_byte = *reinterpret_cast<uint8*>(&v16);
+ uint16_t v16 = 0x1234u;
+ uint8_t first_byte = *reinterpret_cast<uint8_t*>(&v16);
#if defined(RTC_ARCH_CPU_LITTLE_ENDIAN)
EXPECT_EQ(0x34u, first_byte);
#elif defined(RTC_ARCH_CPU_BIG_ENDIAN)
@@ -33,33 +24,6 @@ TEST(BasicTypesTest, Endian) {
#endif
}
-TEST(BasicTypesTest, SizeOfTypes) {
- int8 i8 = -1;
- uint8 u8 = 1u;
- int16 i16 = -1;
- uint16 u16 = 1u;
- int32 i32 = -1;
- uint32 u32 = 1u;
- int64 i64 = -1;
- uint64 u64 = 1u;
- EXPECT_EQ(1u, sizeof(i8));
- EXPECT_EQ(1u, sizeof(u8));
- EXPECT_EQ(2u, sizeof(i16));
- EXPECT_EQ(2u, sizeof(u16));
- EXPECT_EQ(4u, sizeof(i32));
- EXPECT_EQ(4u, sizeof(u32));
- EXPECT_EQ(8u, sizeof(i64));
- EXPECT_EQ(8u, sizeof(u64));
- EXPECT_GT(0, i8);
- EXPECT_LT(0u, u8);
- EXPECT_GT(0, i16);
- EXPECT_LT(0u, u16);
- EXPECT_GT(0, i32);
- EXPECT_LT(0u, u32);
- EXPECT_GT(0, i64);
- EXPECT_LT(0u, u64);
-}
-
TEST(BasicTypesTest, SizeOfConstants) {
EXPECT_EQ(8u, sizeof(INT64_C(0)));
EXPECT_EQ(8u, sizeof(UINT64_C(0)));
« no previous file with comments | « webrtc/base/bandwidthsmoother.cc ('k') | webrtc/base/bitbuffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698