Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4af62ee9 authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "Add missing stack dependencies and fix test linker"

parents 6b35cd82 cb89c364
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -658,8 +658,6 @@ cc_test {
          "libbt-sbc-encoder",
          "libbtif",
          "libbtif-core",
          "libbt-stack",
          "libbt-stack-core",
          "libbtdevice",
          "lib-bt-packets",
          "lib-bt-packets-avrcp",
+1 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ cc_test {
    include_dirs: [
        "packages/modules/Bluetooth/system",
        "packages/modules/Bluetooth/system/gd",
        "packages/modules/Bluetooth/system/stack/btm",
        "packages/modules/Bluetooth/system/stack/include",
    ],
    srcs: [
+5 −0
Original line number Diff line number Diff line
@@ -1033,6 +1033,7 @@ cc_test {
    include_dirs: [
        "packages/modules/Bluetooth/system",
        "packages/modules/Bluetooth/system/gd",
        "packages/modules/Bluetooth/system/stack/btm",
    ],
    srcs: crypto_toolbox_srcs + [
        ":TestMockStackL2cap",
@@ -1086,6 +1087,7 @@ cc_test {
    include_dirs: [
        "packages/modules/Bluetooth/system",
        "packages/modules/Bluetooth/system/gd",
        "packages/modules/Bluetooth/system/stack/btm",
    ],
    generated_headers: [
        "BluetoothGeneratedDumpsysDataSchema_h",
@@ -1148,6 +1150,7 @@ cc_test {
    include_dirs: [
        "packages/modules/Bluetooth/system",
        "packages/modules/Bluetooth/system/gd",
        "packages/modules/Bluetooth/system/stack/btm",
        "packages/modules/Bluetooth/system/utils/include",
    ],
    generated_headers: [
@@ -1224,6 +1227,7 @@ cc_test {
    include_dirs: [
        "packages/modules/Bluetooth/system",
        "packages/modules/Bluetooth/system/gd",
        "packages/modules/Bluetooth/system/stack/btm",
        "packages/modules/Bluetooth/system/utils/include",
    ],
    generated_headers: [
@@ -1296,6 +1300,7 @@ cc_test {
    include_dirs: [
        "packages/modules/Bluetooth/system",
        "packages/modules/Bluetooth/system/gd",
        "packages/modules/Bluetooth/system/stack/btm",
        "packages/modules/Bluetooth/system/utils/include",
    ],
    generated_headers: [
+78 −0
Original line number Diff line number Diff line
/*
 * Copyright 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * Generated mock file from original source file
 *   Functions generated:3
 *
 *  mockcify.pl ver 0.5.0
 */

#include <cstdint>
#include <functional>
#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

// Mock include file to share data between tests and mock
#include "test/mock/mock_stack_btm_hfp_msbc_decoder.h"

// Original usings

// Mocked internal structures, if any

namespace test {
namespace mock {
namespace stack_btm_hfp_msbc_decoder {

// Function state capture and return values, if needed
struct hfp_msbc_decoder_cleanup hfp_msbc_decoder_cleanup;
struct hfp_msbc_decoder_decode_packet hfp_msbc_decoder_decode_packet;
struct hfp_msbc_decoder_init hfp_msbc_decoder_init;

}  // namespace stack_btm_hfp_msbc_decoder
}  // namespace mock
}  // namespace test

// Mocked function return values, if any
namespace test {
namespace mock {
namespace stack_btm_hfp_msbc_decoder {

bool hfp_msbc_decoder_decode_packet::return_value = false;
bool hfp_msbc_decoder_init::return_value = false;

}  // namespace stack_btm_hfp_msbc_decoder
}  // namespace mock
}  // namespace test

// Mocked functions, if any
void hfp_msbc_decoder_cleanup(void) {
  mock_function_count_map[__func__]++;
  test::mock::stack_btm_hfp_msbc_decoder::hfp_msbc_decoder_cleanup();
}
bool hfp_msbc_decoder_decode_packet(const uint8_t* i_buf, int16_t* o_buf,
                                    size_t out_len) {
  mock_function_count_map[__func__]++;
  return test::mock::stack_btm_hfp_msbc_decoder::hfp_msbc_decoder_decode_packet(
      i_buf, o_buf, out_len);
}
bool hfp_msbc_decoder_init() {
  mock_function_count_map[__func__]++;
  return test::mock::stack_btm_hfp_msbc_decoder::hfp_msbc_decoder_init();
}
// Mocked functions complete
// END mockcify generation
+94 −0
Original line number Diff line number Diff line
/*
 * Copyright 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#pragma once

/*
 * Generated mock file from original source file
 *   Functions generated:3
 *
 *  mockcify.pl ver 0.5.0
 */

#include <cstdint>
#include <functional>
#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

// Original included files, if any
// NOTE: Since this is a mock file with mock definitions some number of
//       include files may not be required.  The include-what-you-use
//       still applies, but crafting proper inclusion is out of scope
//       for this effort.  This compilation unit may compile as-is, or
//       may need attention to prune from (or add to ) the inclusion set.
#include <base/logging.h>

#include <cstring>

#include "embdrv/sbc/decoder/include/oi_codec_sbc.h"
#include "embdrv/sbc/decoder/include/oi_status.h"
#include "hfp_msbc_decoder.h"
#include "osi/include/log.h"

// Original usings

// Mocked compile conditionals, if any

namespace test {
namespace mock {
namespace stack_btm_hfp_msbc_decoder {

// Shared state between mocked functions and tests
// Name: hfp_msbc_decoder_cleanup
// Params: void
// Return: void
struct hfp_msbc_decoder_cleanup {
  std::function<void(void)> body{[](void) {}};
  void operator()(void) { body(); };
};
extern struct hfp_msbc_decoder_cleanup hfp_msbc_decoder_cleanup;

// Name: hfp_msbc_decoder_decode_packet
// Params: const uint8_t* i_buf, int16_t* o_buf, size_t out_len
// Return: bool
struct hfp_msbc_decoder_decode_packet {
  static bool return_value;
  std::function<bool(const uint8_t* i_buf, int16_t* o_buf, size_t out_len)>
      body{[](const uint8_t* i_buf, int16_t* o_buf, size_t out_len) {
        return return_value;
      }};
  bool operator()(const uint8_t* i_buf, int16_t* o_buf, size_t out_len) {
    return body(i_buf, o_buf, out_len);
  };
};
extern struct hfp_msbc_decoder_decode_packet hfp_msbc_decoder_decode_packet;

// Name: hfp_msbc_decoder_init
// Params:
// Return: bool
struct hfp_msbc_decoder_init {
  static bool return_value;
  std::function<bool()> body{[]() { return return_value; }};
  bool operator()() { return body(); };
};
extern struct hfp_msbc_decoder_init hfp_msbc_decoder_init;

}  // namespace stack_btm_hfp_msbc_decoder
}  // namespace mock
}  // namespace test

// END mockcify generation
 No newline at end of file
Loading