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

Unified Diff: webrtc/common_video/h264/profile_level_id_unittest.cc

Issue 2477923002: Add more tests for H264 profile level id parsing (Closed)
Patch Set: Created 4 years, 1 month 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/common_video/h264/profile_level_id.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/h264/profile_level_id_unittest.cc
diff --git a/webrtc/common_video/h264/profile_level_id_unittest.cc b/webrtc/common_video/h264/profile_level_id_unittest.cc
index 8bc50689d98479ae7566318939df1ffd34029b1c..491fda14aaf89fb80be630dcfef5d357832948df 100644
--- a/webrtc/common_video/h264/profile_level_id_unittest.cc
+++ b/webrtc/common_video/h264/profile_level_id_unittest.cc
@@ -75,7 +75,7 @@ TEST(H264ProfileLevelId, TestToString) {
kProfileConstrainedBaseline, kLevel3_1)));
EXPECT_EQ("42000a",
*ProfileLevelIdToString(ProfileLevelId(kProfileBaseline, kLevel1)));
- EXPECT_EQ("4D001f",
+ EXPECT_EQ("4d001f",
ProfileLevelIdToString(ProfileLevelId(kProfileMain, kLevel3_1)));
EXPECT_EQ("640c2a", *ProfileLevelIdToString(
ProfileLevelId(kProfileConstrainedHigh, kLevel4_2)));
@@ -88,10 +88,19 @@ TEST(H264ProfileLevelId, TestToStringLevel1b) {
kProfileConstrainedBaseline, kLevel1_b)));
EXPECT_EQ("42100b", *ProfileLevelIdToString(
ProfileLevelId(kProfileBaseline, kLevel1_b)));
- EXPECT_EQ("4D100b",
+ EXPECT_EQ("4d100b",
*ProfileLevelIdToString(ProfileLevelId(kProfileMain, kLevel1_b)));
}
+TEST(H264ProfileLevelId, TestToStringRoundTrip) {
+ EXPECT_EQ("42e01f", *ProfileLevelIdToString(*ParseProfileLevelId("42e01f")));
+ EXPECT_EQ("42e01f", *ProfileLevelIdToString(*ParseProfileLevelId("42E01F")));
+ EXPECT_EQ("4d100b", *ProfileLevelIdToString(*ParseProfileLevelId("4d100b")));
+ EXPECT_EQ("4d100b", *ProfileLevelIdToString(*ParseProfileLevelId("4D100B")));
+ EXPECT_EQ("640c2a", *ProfileLevelIdToString(*ParseProfileLevelId("640c2a")));
+ EXPECT_EQ("640c2a", *ProfileLevelIdToString(*ParseProfileLevelId("640C2A")));
+}
+
TEST(H264ProfileLevelId, TestToStringInvalid) {
EXPECT_FALSE(ProfileLevelIdToString(ProfileLevelId(kProfileHigh, kLevel1_b)));
EXPECT_FALSE(ProfileLevelIdToString(
« no previous file with comments | « webrtc/common_video/h264/profile_level_id.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698