Index: talk/app/webrtc/sctputils_unittest.cc |
diff --git a/talk/app/webrtc/sctputils_unittest.cc b/talk/app/webrtc/sctputils_unittest.cc |
index e5f323aa226285cb8a010aed6e927a022784ca67..e0e203f5cd314c86742fdec53dd7de4abb4a29da 100644 |
--- a/talk/app/webrtc/sctputils_unittest.cc |
+++ b/talk/app/webrtc/sctputils_unittest.cc |
@@ -1,6 +1,6 @@ |
/* |
* libjingle |
- * Copyright 2013 Google Inc |
+ * Copyright 2013 Google Inc. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
@@ -159,3 +159,20 @@ TEST_F(SctpUtilsTest, WriteParseAckMessage) { |
EXPECT_TRUE(webrtc::ParseDataChannelOpenAckMessage(packet)); |
} |
+ |
+TEST_F(SctpUtilsTest, TestIsOpenMessage) { |
+ rtc::ByteBuffer open; |
+ open.WriteUInt8(0x03); |
+ EXPECT_TRUE(webrtc::IsOpenMessage(open)); |
+ |
+ rtc::ByteBuffer openAck; |
+ openAck.WriteUInt8(0x02); |
+ EXPECT_FALSE(webrtc::IsOpenMessage(open)); |
+ |
+ rtc::ByteBuffer invalid; |
+ openAck.WriteUInt8(0x01); |
+ EXPECT_FALSE(webrtc::IsOpenMessage(invalid)); |
+ |
+ rtc::ByteBuffer empty; |
+ EXPECT_FALSE(webrtc::IsOpenMessage(empty)); |
+} |