"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/common/bit_reader.cpp" between
mkvtoolnix-30.1.0.tar.xz and mkvtoolnix-31.0.0.tar.xz

About: MKVToolNix is a set of tools to create, alter and inspect Matroska files (the open standard audio/video multimedia container format).

bit_reader.cpp  (mkvtoolnix-30.1.0.tar.xz):bit_reader.cpp  (mkvtoolnix-31.0.0.tar.xz)
skipping to change at line 85 skipping to change at line 85
// a81 = 101 010 000 // a81 = 101 010 000
EXPECT_EQ(0x05, b.get_bits(3)); EXPECT_EQ(0x05, b.get_bits(3));
EXPECT_EQ(0x02, b.get_bits(3)); EXPECT_EQ(0x02, b.get_bits(3));
EXPECT_EQ(0x00, b.get_bits(3)); EXPECT_EQ(0x00, b.get_bits(3));
EXPECT_EQ(29, b.get_bit_position()); EXPECT_EQ(29, b.get_bit_position());
EXPECT_EQ( 3, b.get_remaining_bits()); EXPECT_EQ( 3, b.get_remaining_bits());
EXPECT_FALSE(b.eof()); EXPECT_FALSE(b.eof());
} }
TEST(BitReader, GetString) {
char const *value = "47110815";
auto b = mtx::bits::reader_c{reinterpret_cast<unsigned char const *>(value), 8
};
b.skip_bits(8);
EXPECT_EQ(std::string{"711"}, b.get_string(3));
EXPECT_THROW(b.get_string(5), mtx::mm_io::end_of_file_x);
}
TEST(BitReader, GetUnsignedGolomb) { TEST(BitReader, GetUnsignedGolomb) {
unsigned char value[4]; unsigned char value[4];
put_uint32_be(value, 0xf7234a81); put_uint32_be(value, 0xf7234a81);
auto b = mtx::bits::reader_c{value, 4}; auto b = mtx::bits::reader_c{value, 4};
// 1111 0111 // 1111 0111
EXPECT_EQ( 0, b.get_unsigned_golomb()); EXPECT_EQ( 0, b.get_unsigned_golomb());
EXPECT_EQ( 1, b.get_bit_position()); EXPECT_EQ( 1, b.get_bit_position());
EXPECT_EQ(0x07, b.get_bits(3)); EXPECT_EQ(0x07, b.get_bits(3));
 End of changes. 1 change blocks. 
0 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)