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

Unified Diff: webrtc/base/bytebuffer_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/bytebuffer.cc ('k') | webrtc/base/byteorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/bytebuffer_unittest.cc
diff --git a/webrtc/base/bytebuffer_unittest.cc b/webrtc/base/bytebuffer_unittest.cc
index f4b0504efc8622f922d337c121a19b2eb07fce24..56b0e055f52aa3a263de5d994a82b7b1c8c7473b 100644
--- a/webrtc/base/bytebuffer_unittest.cc
+++ b/webrtc/base/bytebuffer_unittest.cc
@@ -16,9 +16,9 @@
namespace rtc {
TEST(ByteBufferTest, TestByteOrder) {
- uint16 n16 = 1;
- uint32 n32 = 1;
- uint64 n64 = 1;
+ uint16_t n16 = 1;
+ uint32_t n32 = 1;
+ uint64_t n64 = 1;
EXPECT_EQ(n16, NetworkToHost16(HostToNetwork16(n16)));
EXPECT_EQ(n32, NetworkToHost32(HostToNetwork32(n32)));
@@ -117,45 +117,45 @@ TEST(ByteBufferTest, TestReadWriteBuffer) {
for (size_t i = 0; i < ARRAY_SIZE(orders); i++) {
ByteBuffer buffer(orders[i]);
EXPECT_EQ(orders[i], buffer.Order());
- uint8 ru8;
+ uint8_t ru8;
EXPECT_FALSE(buffer.ReadUInt8(&ru8));
- // Write and read uint8.
- uint8 wu8 = 1;
+ // Write and read uint8_t.
+ uint8_t wu8 = 1;
buffer.WriteUInt8(wu8);
EXPECT_TRUE(buffer.ReadUInt8(&ru8));
EXPECT_EQ(wu8, ru8);
EXPECT_EQ(0U, buffer.Length());
- // Write and read uint16.
- uint16 wu16 = (1 << 8) + 1;
+ // Write and read uint16_t.
+ uint16_t wu16 = (1 << 8) + 1;
buffer.WriteUInt16(wu16);
- uint16 ru16;
+ uint16_t ru16;
EXPECT_TRUE(buffer.ReadUInt16(&ru16));
EXPECT_EQ(wu16, ru16);
EXPECT_EQ(0U, buffer.Length());
// Write and read uint24.
- uint32 wu24 = (3 << 16) + (2 << 8) + 1;
+ uint32_t wu24 = (3 << 16) + (2 << 8) + 1;
buffer.WriteUInt24(wu24);
- uint32 ru24;
+ uint32_t ru24;
EXPECT_TRUE(buffer.ReadUInt24(&ru24));
EXPECT_EQ(wu24, ru24);
EXPECT_EQ(0U, buffer.Length());
- // Write and read uint32.
- uint32 wu32 = (4 << 24) + (3 << 16) + (2 << 8) + 1;
+ // Write and read uint32_t.
+ uint32_t wu32 = (4 << 24) + (3 << 16) + (2 << 8) + 1;
buffer.WriteUInt32(wu32);
- uint32 ru32;
+ uint32_t ru32;
EXPECT_TRUE(buffer.ReadUInt32(&ru32));
EXPECT_EQ(wu32, ru32);
EXPECT_EQ(0U, buffer.Length());
- // Write and read uint64.
- uint32 another32 = (8 << 24) + (7 << 16) + (6 << 8) + 5;
- uint64 wu64 = (static_cast<uint64>(another32) << 32) + wu32;
+ // Write and read uint64_t.
+ uint32_t another32 = (8 << 24) + (7 << 16) + (6 << 8) + 5;
+ uint64_t wu64 = (static_cast<uint64_t>(another32) << 32) + wu32;
buffer.WriteUInt64(wu64);
- uint64 ru64;
+ uint64_t ru64;
EXPECT_TRUE(buffer.ReadUInt64(&ru64));
EXPECT_EQ(wu64, ru64);
EXPECT_EQ(0U, buffer.Length());
« no previous file with comments | « webrtc/base/bytebuffer.cc ('k') | webrtc/base/byteorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698