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

Unified Diff: webrtc/p2p/base/port_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/p2p/base/port.cc ('k') | webrtc/p2p/base/portallocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/port_unittest.cc
diff --git a/webrtc/p2p/base/port_unittest.cc b/webrtc/p2p/base/port_unittest.cc
index 4c262bc93e04ae08686b2bdde32192cdaa7af588..4a4ed324565ab6d4889657a98f4eada87cd15ed1 100644
--- a/webrtc/p2p/base/port_unittest.cc
+++ b/webrtc/p2p/base/port_unittest.cc
@@ -62,8 +62,9 @@ static const RelayCredentials kRelayCredentials("test", "test");
// TODO: Update these when RFC5245 is completely supported.
// Magic value of 30 is from RFC3484, for IPv4 addresses.
-static const uint32 kDefaultPrflxPriority = ICE_TYPE_PREFERENCE_PRFLX << 24 |
- 30 << 8 | (256 - ICE_CANDIDATE_COMPONENT_DEFAULT);
+static const uint32_t kDefaultPrflxPriority =
+ ICE_TYPE_PREFERENCE_PRFLX << 24 | 30 << 8 |
+ (256 - ICE_CANDIDATE_COMPONENT_DEFAULT);
static const int kTiebreaker1 = 11111;
static const int kTiebreaker2 = 22222;
@@ -100,13 +101,19 @@ class TestPort : public Port {
rtc::PacketSocketFactory* factory,
rtc::Network* network,
const rtc::IPAddress& ip,
- uint16 min_port,
- uint16 max_port,
+ uint16_t min_port,
+ uint16_t max_port,
const std::string& username_fragment,
const std::string& password)
- : Port(thread, type, factory, network, ip, min_port, max_port,
- username_fragment, password) {
- }
+ : Port(thread,
+ type,
+ factory,
+ network,
+ ip,
+ min_port,
+ max_port,
+ username_fragment,
+ password) {}
~TestPort() {}
// Expose GetStunMessage so that we can test it.
@@ -249,9 +256,7 @@ class TestChannel : public sigslot::has_slots<> {
void Ping() {
Ping(0);
}
- void Ping(uint32 now) {
- conn_->Ping(now);
- }
+ void Ping(uint32_t now) { conn_->Ping(now); }
void Stop() {
if (conn_) {
conn_->Destroy();
@@ -904,8 +909,8 @@ class FakePacketSocketFactory : public rtc::PacketSocketFactory {
~FakePacketSocketFactory() override { }
AsyncPacketSocket* CreateUdpSocket(const SocketAddress& address,
- uint16 min_port,
- uint16 max_port) override {
+ uint16_t min_port,
+ uint16_t max_port) override {
EXPECT_TRUE(next_udp_socket_ != NULL);
AsyncPacketSocket* result = next_udp_socket_;
next_udp_socket_ = NULL;
@@ -913,8 +918,8 @@ class FakePacketSocketFactory : public rtc::PacketSocketFactory {
}
AsyncPacketSocket* CreateServerTcpSocket(const SocketAddress& local_address,
- uint16 min_port,
- uint16 max_port,
+ uint16_t min_port,
+ uint16_t max_port,
int opts) override {
EXPECT_TRUE(next_server_tcp_socket_ != NULL);
AsyncPacketSocket* result = next_server_tcp_socket_;
@@ -1967,13 +1972,13 @@ TEST_F(PortTest, TestHandleStunBindingIndication) {
rtc::PacketTime());
ASSERT_TRUE_WAIT(lport->last_stun_msg() != NULL, 1000);
EXPECT_EQ(STUN_BINDING_RESPONSE, lport->last_stun_msg()->type());
- uint32 last_ping_received1 = lconn->last_ping_received();
+ uint32_t last_ping_received1 = lconn->last_ping_received();
// Adding a delay of 100ms.
rtc::Thread::Current()->ProcessMessages(100);
// Pinging lconn using stun indication message.
lconn->OnReadPacket(buf->Data(), buf->Length(), rtc::PacketTime());
- uint32 last_ping_received2 = lconn->last_ping_received();
+ uint32_t last_ping_received2 = lconn->last_ping_received();
EXPECT_GT(last_ping_received2, last_ping_received1);
}
@@ -1993,15 +1998,15 @@ TEST_F(PortTest, TestComputeCandidatePriority) {
port->AddCandidateAddress(SocketAddress("3ffe::1234:5678", 1234));
// These should all be:
// (90 << 24) | ([rfc3484 pref value] << 8) | (256 - 177)
- uint32 expected_priority_v4 = 1509957199U;
- uint32 expected_priority_v6 = 1509959759U;
- uint32 expected_priority_ula = 1509962319U;
- uint32 expected_priority_v4mapped = expected_priority_v4;
- uint32 expected_priority_v4compat = 1509949775U;
- uint32 expected_priority_6to4 = 1509954639U;
- uint32 expected_priority_teredo = 1509952079U;
- uint32 expected_priority_sitelocal = 1509949775U;
- uint32 expected_priority_6bone = 1509949775U;
+ uint32_t expected_priority_v4 = 1509957199U;
+ uint32_t expected_priority_v6 = 1509959759U;
+ uint32_t expected_priority_ula = 1509962319U;
+ uint32_t expected_priority_v4mapped = expected_priority_v4;
+ uint32_t expected_priority_v4compat = 1509949775U;
+ uint32_t expected_priority_6to4 = 1509954639U;
+ uint32_t expected_priority_teredo = 1509952079U;
+ uint32_t expected_priority_sitelocal = 1509949775U;
+ uint32_t expected_priority_6bone = 1509949775U;
ASSERT_EQ(expected_priority_v4, port->Candidates()[0].priority());
ASSERT_EQ(expected_priority_v6, port->Candidates()[1].priority());
ASSERT_EQ(expected_priority_ula, port->Candidates()[2].priority());
@@ -2233,10 +2238,10 @@ TEST_F(PortTest, TestWritableState) {
// Ask the connection to update state as if enough time has passed to lose
// full writability and 5 pings went unresponded to. We'll accomplish the
// latter by sending pings but not pumping messages.
- for (uint32 i = 1; i <= CONNECTION_WRITE_CONNECT_FAILURES; ++i) {
+ for (uint32_t i = 1; i <= CONNECTION_WRITE_CONNECT_FAILURES; ++i) {
ch1.Ping(i);
}
- uint32 unreliable_timeout_delay = CONNECTION_WRITE_CONNECT_TIMEOUT + 500u;
+ uint32_t unreliable_timeout_delay = CONNECTION_WRITE_CONNECT_TIMEOUT + 500u;
ch1.conn()->UpdateState(unreliable_timeout_delay);
EXPECT_EQ(Connection::STATE_WRITE_UNRELIABLE, ch1.conn()->write_state());
@@ -2250,7 +2255,7 @@ TEST_F(PortTest, TestWritableState) {
// Wait long enough for a full timeout (past however long we've already
// waited).
- for (uint32 i = 1; i <= CONNECTION_WRITE_CONNECT_FAILURES; ++i) {
+ for (uint32_t i = 1; i <= CONNECTION_WRITE_CONNECT_FAILURES; ++i) {
ch1.Ping(unreliable_timeout_delay + i);
}
ch1.conn()->UpdateState(unreliable_timeout_delay + CONNECTION_WRITE_TIMEOUT +
@@ -2283,7 +2288,7 @@ TEST_F(PortTest, TestTimeoutForNeverWritable) {
EXPECT_EQ(Connection::STATE_WRITE_INIT, ch1.conn()->write_state());
// Attempt to go directly to write timeout.
- for (uint32 i = 1; i <= CONNECTION_WRITE_CONNECT_FAILURES; ++i) {
+ for (uint32_t i = 1; i <= CONNECTION_WRITE_CONNECT_FAILURES; ++i) {
ch1.Ping(i);
}
ch1.conn()->UpdateState(CONNECTION_WRITE_TIMEOUT + 500u);
« no previous file with comments | « webrtc/p2p/base/port.cc ('k') | webrtc/p2p/base/portallocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698