2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
10 #include "third_party/googletest/src/include/gtest/gtest.h"
11 #include "test/encode_test_driver.h"
12 #include "test/video_source.h"
16 class ConfigTest : public ::libvpx_test::EncoderTest,
17 public ::testing::TestWithParam<enum libvpx_test::TestMode> {
19 ConfigTest() : frame_count_in_(0), frame_count_out_(0), frame_count_max_(0) {}
22 virtual void SetUp() {
27 virtual void BeginPassHook(unsigned int /*pass*/) {
32 virtual void PreEncodeFrameHook(libvpx_test::VideoSource* /*video*/) {
34 abort_ |= (frame_count_in_ >= frame_count_max_);
37 virtual void FramePktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {
41 virtual bool Continue() const {
42 return !HasFatalFailure() && !abort_;
45 unsigned int frame_count_in_;
46 unsigned int frame_count_out_;
47 unsigned int frame_count_max_;
50 TEST_P(ConfigTest, LagIsDisabled) {
52 cfg_.g_lag_in_frames = 15;
54 libvpx_test::DummyVideoSource video;
55 ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
57 EXPECT_EQ(frame_count_in_, frame_count_out_);
60 INSTANTIATE_TEST_CASE_P(OnePassModes, ConfigTest, ONE_PASS_TEST_MODES);