• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023, 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 #ifndef COMMON_TESTS_TEST_UTILS_H_
13 #define COMMON_TESTS_TEST_UTILS_H_
14 
15 #include <cstdint>
16 #include <vector>
17 
18 #include "iamf/common/write_bit_buffer.h"
19 
20 namespace iamf_tools {
21 
22 /*!\brief Validates the byte-aligned buffer matches the expected data.
23  *
24  * \param wb Buffer to validate.
25  * \param expected_data Expected data that was written to the underlying buffer.
26  */
27 void ValidateWriteResults(const WriteBitBuffer& wb,
28                           const std::vector<uint8_t>& expected_data);
29 
30 /*!\brief Validates the buffer matches the expected OBU header and payload.
31  *
32  * \param wb Buffer to validate.
33  * \param expected_header Expected OBU header that was written to the underlying
34  *        buffer.
35  * \param expected_payload Expected OBU payload data that was written to the
36  *        underlying buffer.
37  */
38 void ValidateObuWriteResults(const WriteBitBuffer& wb,
39                              const std::vector<uint8_t>& expected_header,
40                              const std::vector<uint8_t>& expected_payload);
41 
42 }  // namespace iamf_tools
43 
44 #endif  // COMMON_TESTS_TEST_UTILS_H_
45