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

Side by Side Diff: talk/media/base/rtpdataengine_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 unified diff | Download patch
« no previous file with comments | « talk/media/base/rtpdataengine.cc ('k') | talk/media/base/rtpdump.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 SetNow(2); 295 SetNow(2);
296 296
297 EXPECT_TRUE(dmc->SendData(params, payload, &result)); 297 EXPECT_TRUE(dmc->SendData(params, payload, &result));
298 ASSERT_TRUE(HasSentData(1)); 298 ASSERT_TRUE(HasSentData(1));
299 EXPECT_EQ(sizeof(padded_data), GetSentData(1).length()); 299 EXPECT_EQ(sizeof(padded_data), GetSentData(1).length());
300 EXPECT_EQ(0, memcmp( 300 EXPECT_EQ(0, memcmp(
301 padded_data, GetSentData(1).data(), sizeof(padded_data))); 301 padded_data, GetSentData(1).data(), sizeof(padded_data)));
302 cricket::RtpHeader header1 = GetSentDataHeader(1); 302 cricket::RtpHeader header1 = GetSentDataHeader(1);
303 EXPECT_EQ(header1.ssrc, 42U); 303 EXPECT_EQ(header1.ssrc, 42U);
304 EXPECT_EQ(header1.payload_type, 103); 304 EXPECT_EQ(header1.payload_type, 103);
305 EXPECT_EQ(static_cast<uint16>(header0.seq_num + 1), 305 EXPECT_EQ(static_cast<uint16_t>(header0.seq_num + 1),
306 static_cast<uint16>(header1.seq_num)); 306 static_cast<uint16_t>(header1.seq_num));
307 EXPECT_EQ(header0.timestamp + 180000, header1.timestamp); 307 EXPECT_EQ(header0.timestamp + 180000, header1.timestamp);
308 } 308 }
309 309
310 TEST_F(RtpDataMediaChannelTest, SendDataMultipleClocks) { 310 TEST_F(RtpDataMediaChannelTest, SendDataMultipleClocks) {
311 // Timings owned by RtpDataEngines. 311 // Timings owned by RtpDataEngines.
312 FakeTiming* timing1 = new FakeTiming(); 312 FakeTiming* timing1 = new FakeTiming();
313 rtc::scoped_ptr<cricket::RtpDataEngine> dme1(CreateEngine(timing1)); 313 rtc::scoped_ptr<cricket::RtpDataEngine> dme1(CreateEngine(timing1));
314 rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc1( 314 rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc1(
315 CreateChannel(dme1.get())); 315 CreateChannel(dme1.get()));
316 FakeTiming* timing2 = new FakeTiming(); 316 FakeTiming* timing2 = new FakeTiming();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 EXPECT_TRUE(dmc1->SendData(params1, payload, &result)); 356 EXPECT_TRUE(dmc1->SendData(params1, payload, &result));
357 EXPECT_TRUE(dmc2->SendData(params2, payload, &result)); 357 EXPECT_TRUE(dmc2->SendData(params2, payload, &result));
358 358
359 ASSERT_TRUE(HasSentData(3)); 359 ASSERT_TRUE(HasSentData(3));
360 cricket::RtpHeader header1a = GetSentDataHeader(0); 360 cricket::RtpHeader header1a = GetSentDataHeader(0);
361 cricket::RtpHeader header2a = GetSentDataHeader(1); 361 cricket::RtpHeader header2a = GetSentDataHeader(1);
362 cricket::RtpHeader header1b = GetSentDataHeader(2); 362 cricket::RtpHeader header1b = GetSentDataHeader(2);
363 cricket::RtpHeader header2b = GetSentDataHeader(3); 363 cricket::RtpHeader header2b = GetSentDataHeader(3);
364 364
365 EXPECT_EQ(static_cast<uint16>(header1a.seq_num + 1), 365 EXPECT_EQ(static_cast<uint16_t>(header1a.seq_num + 1),
366 static_cast<uint16>(header1b.seq_num)); 366 static_cast<uint16_t>(header1b.seq_num));
367 EXPECT_EQ(header1a.timestamp + 90000, header1b.timestamp); 367 EXPECT_EQ(header1a.timestamp + 90000, header1b.timestamp);
368 EXPECT_EQ(static_cast<uint16>(header2a.seq_num + 1), 368 EXPECT_EQ(static_cast<uint16_t>(header2a.seq_num + 1),
369 static_cast<uint16>(header2b.seq_num)); 369 static_cast<uint16_t>(header2b.seq_num));
370 EXPECT_EQ(header2a.timestamp + 180000, header2b.timestamp); 370 EXPECT_EQ(header2a.timestamp + 180000, header2b.timestamp);
371 } 371 }
372 372
373 TEST_F(RtpDataMediaChannelTest, SendDataRate) { 373 TEST_F(RtpDataMediaChannelTest, SendDataRate) {
374 rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel()); 374 rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
375 375
376 ASSERT_TRUE(dmc->SetSend(true)); 376 ASSERT_TRUE(dmc->SetSend(true));
377 377
378 cricket::DataCodec codec; 378 cricket::DataCodec codec;
379 codec.id = 103; 379 codec.id = 103;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 0x80, 0x65, 0x00, 0x02 468 0x80, 0x65, 0x00, 0x02
469 }; 469 };
470 rtc::Buffer packet(data, sizeof(data)); 470 rtc::Buffer packet(data, sizeof(data));
471 471
472 rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel()); 472 rtc::scoped_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
473 473
474 // Too short 474 // Too short
475 dmc->OnPacketReceived(&packet, rtc::PacketTime()); 475 dmc->OnPacketReceived(&packet, rtc::PacketTime());
476 EXPECT_FALSE(HasReceivedData()); 476 EXPECT_FALSE(HasReceivedData());
477 } 477 }
OLDNEW
« no previous file with comments | « talk/media/base/rtpdataengine.cc ('k') | talk/media/base/rtpdump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698