1 /*
2  * Copyright 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <gtest/gtest.h>
18 
19 #include "a2dp_vendor_ldac.h"
20 #include "a2dp_vendor_opus.h"
21 
22 // namespace
23 namespace bluetooth {
24 namespace testing {
25 
26 class A2DPVendorRegressionTests : public ::testing::Test {
27  protected:
SetUp()28   void SetUp() override {}
TearDown()29   void TearDown() override {}
30 };
31 
32 // regression test for b/259704719
TEST_F(A2DPVendorRegressionTests,OOB_In_A2DP_VendorBuildCodecHeaderLdac)33 TEST_F(A2DPVendorRegressionTests, OOB_In_A2DP_VendorBuildCodecHeaderLdac) {
34   BT_HDR hdr{};
35   hdr.len = sizeof(BT_HDR);
36   A2DP_VendorBuildCodecHeaderLdac(nullptr, &hdr, 0);
37 }
38 
39 // regression test for b/259704719
TEST_F(A2DPVendorRegressionTests,OOB_In_A2DP_VendorBuildCodecHeaderOpus)40 TEST_F(A2DPVendorRegressionTests, OOB_In_A2DP_VendorBuildCodecHeaderOpus) {
41   BT_HDR hdr{};
42   hdr.len = sizeof(BT_HDR);
43   A2DP_VendorBuildCodecHeaderOpus(nullptr, &hdr, 0);
44 }
45 
46 }  // namespace testing
47 }  // namespace bluetooth
48