~ubuntu-branches/ubuntu/wily/mkvtoolnix/wily

« back to all changes in this revision

Viewing changes to tests/unit/common/fourcc.cpp

  • Committer: Package Import Robot
  • Author(s): Christian Marillat
  • Date: 2015-04-26 10:36:27 UTC
  • mfrom: (1.1.29) (4.2.45 sid)
  • Revision ID: package-import@ubuntu.com-20150426103627-k53p8hrai2ynikaa
Tags: 7.8.0-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
TEST(FourCC, Stringification) {
149
149
  fourcc_c big_f{big};
150
150
 
151
 
  EXPECT_EQ(big_f.str(), "1234");
 
151
  EXPECT_EQ("1234", big_f.str());
152
152
 
153
153
  std::stringstream sstr;
154
154
  EXPECT_NO_THROW(sstr << big_f);
155
 
  EXPECT_EQ(sstr.str(), "1234");
156
 
 
157
 
  EXPECT_EQ(fourcc_c{}.str(),           "????");
158
 
  EXPECT_EQ(fourcc_c{0x31003200}.str(), "1?2?");
 
155
  EXPECT_EQ("1234", sstr.str());
 
156
 
 
157
  EXPECT_EQ("????", fourcc_c{}.str());
 
158
  EXPECT_EQ("1?2?", fourcc_c{0x31003200}.str());
 
159
}
 
160
 
 
161
TEST(FourCC, StringificationAsDescription) {
 
162
  EXPECT_EQ("0x31323334 »1234«",                       fourcc_c{big}.description());
 
163
  EXPECT_EQ("0x00000000 »????« (Uncompressed)",        fourcc_c{}.description());
 
164
  EXPECT_EQ("0x311732f8 »1?2?«",                       fourcc_c{0x311732f8}.description());
 
165
  EXPECT_EQ("0x1f207e7f »? ~?«",                       fourcc_c{0x1f207e7f}.description());
 
166
 
 
167
  EXPECT_EQ("0x63766964 »cvid« (Cinepak)",             fourcc_c{"cvid"}.description());
 
168
  EXPECT_EQ("0x78323634 »x264« (MPEG-4p10/AVC/h.264)", fourcc_c{"x264"}.description());
 
169
  EXPECT_EQ("0x58323634 »X264« (MPEG-4p10/AVC/h.264)", fourcc_c{"X264"}.description());
 
170
 
 
171
  EXPECT_EQ("0x00000000 »????« (Uncompressed)",        fourcc_c{0x00000000u}.description());
159
172
}
160
173
 
161
174
TEST(FourCC, WritingToMemory) {