1 // Copyright (c) 2016 The WebM project authors. All Rights Reserved.
2 //
3 // Use of this source code is governed by a BSD-style license
4 // that can be found in the LICENSE file in the root of the source
5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS. All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree.
8 #include "src/skip_parser.h"
9
10 #include "gtest/gtest.h"
11
12 #include "test_utils/element_parser_test.h"
13 #include "webm/element.h"
14 #include "webm/status.h"
15
16 using webm::ElementParserTest;
17 using webm::kUnknownElementSize;
18 using webm::SkipParser;
19 using webm::Status;
20
21 namespace {
22
23 class SkipParserTest : public ElementParserTest<SkipParser> {};
24
TEST_F(SkipParserTest,InvalidSize)25 TEST_F(SkipParserTest, InvalidSize) {
26 TestInit(kUnknownElementSize, Status::kInvalidElementSize);
27 }
28
TEST_F(SkipParserTest,Skip)29 TEST_F(SkipParserTest, Skip) {
30 ParseAndVerify();
31
32 SetReaderData({0x00, 0x01, 0x02, 0x04});
33 ParseAndVerify();
34 }
35
TEST_F(SkipParserTest,IncrementalSkip)36 TEST_F(SkipParserTest, IncrementalSkip) {
37 SetReaderData({0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10});
38
39 IncrementalParseAndVerify();
40 }
41
42 } // namespace
43