• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025, Alliance for Open Media. All rights reserved
3  *
4  * This source code is subject to the terms of the BSD 3-Clause Clear License
5  * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear
6  * License was not distributed with this source code in the LICENSE file, you
7  * can obtain it at www.aomedia.org/license/software-license/bsd-3-c-c. If the
8  * Alliance for Open Media Patent License 1.0 was not distributed with this
9  * source code in the PATENTS file, you can obtain it at
10  * www.aomedia.org/license/patent.
11  */
12 
13 #ifndef OBU_TESTS_OBU_TEST_UTILS_H_
14 #define OBU_TESTS_OBU_TEST_UTILS_H_
15 
16 #include <cstdint>
17 
18 #include "absl/status/status.h"
19 #include "gmock/gmock.h"
20 #include "iamf/common/read_bit_buffer.h"
21 #include "iamf/common/write_bit_buffer.h"
22 #include "iamf/obu/obu_base.h"
23 #include "iamf/obu/obu_header.h"
24 
25 namespace iamf_tools {
26 
27 /*!\brief A mock OBU. */
28 class MockObu : public ObuBase {
29  public:
30   /*!\brief Constructor.
31    *
32    * \param header OBU header.
33    * \param obu_type OBU type.
34    */
MockObu(const ObuHeader & header,ObuType obu_type)35   MockObu(const ObuHeader& header, ObuType obu_type)
36       : ObuBase(header, obu_type) {}
37 
38   MOCK_METHOD(void, PrintObu, (), (const, override));
39 
40   MOCK_METHOD(absl::Status, ValidateAndWritePayload, (WriteBitBuffer & wb),
41               (const, override));
42 
43   MOCK_METHOD(absl::Status, ReadAndValidatePayloadDerived,
44               (int64_t payload_size, ReadBitBuffer& rb), (override));
45 };
46 
47 }  // namespace iamf_tools
48 #endif  // OBU_TESTS_OBU_TEST_UTILS_H_
49