Bug 1204082 - try strtoull instead. r=mt
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Mon, 14 Sep 2015 16:33:28 -0700
changeset 295380 15e860fa81e36d399c7160623ac37f53ba5ee363
parent 295379 c4333afa007fa4dce1a5a415b0da33a505805d4c
child 295381 6e189be469ed5b54074da69594ff5383ff49da64
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmt
bugs1204082
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1204082 - try strtoull instead. r=mt
media/webrtc/signaling/src/sdp/SipccSdp.cpp
media/webrtc/signaling/test/sdp_unittests.cpp
--- a/media/webrtc/signaling/src/sdp/SipccSdp.cpp
+++ b/media/webrtc/signaling/src/sdp/SipccSdp.cpp
@@ -69,18 +69,18 @@ SipccSdp::AddMediaSection(SdpMediaSectio
   mMediaSections.values.push_back(media);
   return *media;
 }
 
 bool
 SipccSdp::LoadOrigin(sdp_t* sdp, SdpErrorHolder& errorHolder)
 {
   std::string username = sdp_get_owner_username(sdp);
-  uint64_t sessId = strtoul(sdp_get_owner_sessionid(sdp), nullptr, 10);
-  uint64_t sessVer = strtoul(sdp_get_owner_version(sdp), nullptr, 10);
+  uint64_t sessId = strtoull(sdp_get_owner_sessionid(sdp), nullptr, 10);
+  uint64_t sessVer = strtoull(sdp_get_owner_version(sdp), nullptr, 10);
 
   sdp_nettype_e type = sdp_get_owner_network_type(sdp);
   if (type != SDP_NT_INTERNET) {
     errorHolder.AddParseError(2, "Unsupported network type");
     return false;
   }
 
   sdp::AddrType addrType;
--- a/media/webrtc/signaling/test/sdp_unittests.cpp
+++ b/media/webrtc/signaling/test/sdp_unittests.cpp
@@ -260,17 +260,17 @@ class SdpTest : public ::testing::Test {
 
   protected:
     int final_level_;
     sdp_t *sdp_ptr_;
 };
 
 static const std::string kVideoSdp =
   "v=0\r\n"
-  "o=- 137331303 2 IN IP4 127.0.0.1\r\n"
+  "o=- 4294967296 2 IN IP4 127.0.0.1\r\n"
   "s=SIP Call\r\n"
   "c=IN IP4 198.51.100.7\r\n"
   "t=0 0\r\n"
   "m=video 56436 RTP/SAVPF 120\r\n"
   "a=rtpmap:120 VP8/90000\r\n";
 
 TEST_F(SdpTest, parseRtcpFbAckRpsi) {
   ParseSdp(kVideoSdp + "a=rtcp-fb:120 ack rpsi\r\n");
@@ -808,17 +808,17 @@ TEST_F(SdpTest, addFmtpMaxFsFr) {
   AddNewFmtpMaxFsFr(level, 300, 30);
   std::string body = SerializeSdp();
   ASSERT_NE(body.find("a=fmtp:120 max-fs=300;max-fr=30\r\n"),
             std::string::npos);
 }
 
 static const std::string kBrokenFmtp =
   "v=0\r\n"
-  "o=- 137331303 2 IN IP4 127.0.0.1\r\n"
+  "o=- 4294967296 2 IN IP4 127.0.0.1\r\n"
   "s=SIP Call\r\n"
   "t=0 0\r\n"
   "m=video 56436 RTP/SAVPF 120\r\n"
   "c=IN IP4 198.51.100.7\r\n"
   "a=rtpmap:120 VP8/90000\r\n"
   /* Note: the \0 in this string triggered bz://1089207
    */
   "a=fmtp:120 max-fs=300;max\0fr=30";
@@ -841,17 +841,17 @@ TEST_F(SdpTest, addIceLite) {
                                SDP_ATTR_ICE_LITE, &inst_num), SDP_SUCCESS);
     std::string body = SerializeSdp();
     ASSERT_NE(body.find("a=ice-lite\r\n"), std::string::npos);
 }
 
 TEST_F(SdpTest, parseIceLite) {
     std::string sdp =
         "v=0\r\n"
-        "o=- 137331303 2 IN IP4 127.0.0.1\r\n"
+        "o=- 4294967296 2 IN IP4 127.0.0.1\r\n"
         "s=SIP Call\r\n"
         "t=0 0\r\n"
         "a=ice-lite\r\n";
   ParseSdp(sdp);
   ASSERT_TRUE(sdp_attr_is_present(sdp_ptr_, SDP_ATTR_ICE_LITE,
                                   SDP_SESSION_LEVEL, 0));
 }
 
@@ -1001,17 +1001,17 @@ TEST_P(NewSdpTest, ParseMinimal) {
 TEST_P(NewSdpTest, CheckOriginGetUsername) {
   ParseSdp(kVideoSdp);
   ASSERT_EQ("-", mSdp->GetOrigin().GetUsername())
     << "Wrong username in origin";
 }
 
 TEST_P(NewSdpTest, CheckOriginGetSessionId) {
   ParseSdp(kVideoSdp);
-  ASSERT_EQ(137331303U, mSdp->GetOrigin().GetSessionId())
+  ASSERT_EQ(4294967296U, mSdp->GetOrigin().GetSessionId())
     << "Wrong session id in origin";
 }
 
 TEST_P(NewSdpTest, CheckOriginGetSessionVersion) {
   ParseSdp(kVideoSdp);
   ASSERT_EQ(2U , mSdp->GetOrigin().GetSessionVersion())
     << "Wrong version in origin";
 }
@@ -1031,17 +1031,17 @@ TEST_P(NewSdpTest, CheckOriginGetAddress
 TEST_P(NewSdpTest, CheckGetMissingBandwidth) {
   ParseSdp(kVideoSdp);
   ASSERT_EQ(0U, mSdp->GetBandwidth("CT"))
     << "Wrong bandwidth in session";
 }
 
 TEST_P(NewSdpTest, CheckGetBandwidth) {
   ParseSdp("v=0" CRLF
-           "o=- 137331303 2 IN IP4 127.0.0.1" CRLF
+           "o=- 4294967296 2 IN IP4 127.0.0.1" CRLF
            "s=SIP Call" CRLF
            "c=IN IP4 198.51.100.7" CRLF
            "b=CT:5000" CRLF
            "t=0 0" CRLF
            "m=video 56436 RTP/SAVPF 120" CRLF
            "a=rtpmap:120 VP8/90000" CRLF
            );
   ASSERT_EQ(5000U, mSdp->GetBandwidth("CT"))
@@ -1099,17 +1099,17 @@ TEST_P(NewSdpTest, CheckMediaSectionGetP
 TEST_P(NewSdpTest, CheckMediaSectionGetMissingBandwidth) {
   ParseSdp(kVideoSdp);
   ASSERT_EQ(0U, mSdp->GetMediaSection(0).GetBandwidth("CT"))
     << "Wrong bandwidth in media section";
 }
 
 TEST_P(NewSdpTest, CheckMediaSectionGetBandwidth) {
   ParseSdp("v=0\r\n"
-           "o=- 137331303 2 IN IP4 127.0.0.1\r\n"
+           "o=- 4294967296 2 IN IP4 127.0.0.1\r\n"
            "c=IN IP4 198.51.100.7\r\n"
            "t=0 0\r\n"
            "m=video 56436 RTP/SAVPF 120\r\n"
            "b=CT:1000\r\n"
            "a=rtpmap:120 VP8/90000\r\n");
   ASSERT_EQ(1000U, mSdp->GetMediaSection(0).GetBandwidth("CT"))
     << "Wrong bandwidth in media section";
 }