OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include <stdint.h> |
| 6 |
5 #include "media/filters/vp9_raw_bits_reader.h" | 7 #include "media/filters/vp9_raw_bits_reader.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
7 | 9 |
8 namespace media { | 10 namespace media { |
9 | 11 |
10 TEST(Vp9RawBitsReaderTest, ReadBool) { | 12 TEST(Vp9RawBitsReaderTest, ReadBool) { |
11 uint8_t data[] = {0xf1}; | 13 uint8_t data[] = {0xf1}; |
12 Vp9RawBitsReader reader; | 14 Vp9RawBitsReader reader; |
13 reader.Initialize(data, 1); | 15 reader.Initialize(data, 1); |
14 | 16 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 EXPECT_EQ(-0x5679, reader.ReadSignedLiteral(15)); | 59 EXPECT_EQ(-0x5679, reader.ReadSignedLiteral(15)); |
58 EXPECT_TRUE(reader.IsValid()); | 60 EXPECT_TRUE(reader.IsValid()); |
59 | 61 |
60 // The return value is undefined. | 62 // The return value is undefined. |
61 ignore_result(reader.ReadSignedLiteral(7)); | 63 ignore_result(reader.ReadSignedLiteral(7)); |
62 EXPECT_FALSE(reader.IsValid()); | 64 EXPECT_FALSE(reader.IsValid()); |
63 EXPECT_EQ(3u, reader.GetBytesRead()); | 65 EXPECT_EQ(3u, reader.GetBytesRead()); |
64 } | 66 } |
65 | 67 |
66 } // namespace media | 68 } // namespace media |
OLD | NEW |