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

Commit 3c3377e4 authored by Chris Manton's avatar Chris Manton
Browse files

unittest: stack:: Use common log msg

Bug: 264590827
Tag: #refactor
Test: gd/cert/run
Change-Id: I427cb6cf388e68dff662d546acdddbf2251f549e
parent 9ea5e1ee
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -368,6 +368,7 @@ cc_test {
    ],
    srcs: [
        ":TestCommonMockFunctions",
        ":TestCommonLogMsg",
        ":TestMockHci",
        ":TestMockStackMetrics",
        "rfcomm/port_api.cc",
@@ -427,6 +428,7 @@ cc_test {
        "packages/modules/Bluetooth/system/utils/include",
    ],
    srcs: crypto_toolbox_srcs + [
        ":TestCommonLogMsg",
        ":TestCommonMainHandler",
        ":TestMockBtif",
        ":TestMockCommon",
@@ -655,6 +657,7 @@ cc_test {
        "avdt/avdt_scb_act.cc",
        "test/common/mock_btu_layer.cc",
        "test/common/mock_stack_avdt_msg.cc",
        ":TestCommonLogMsg",
        ":TestMockStackL2cap",
        ":TestMockStackAcl",
        ":TestMockStackA2dp",
@@ -1094,6 +1097,7 @@ cc_test {
        "BluetoothGeneratedPackets_h",
    ],
    srcs: [
        ":TestCommonLogMsg",
        ":TestMockBta",
        ":TestMockBtif",
        ":TestMockHci",
@@ -1236,6 +1240,7 @@ cc_test {
    ],
    srcs: [
        ":OsiCompatSources",
        ":TestCommonLogMsg",
        ":TestCommonMainHandler",
        ":TestCommonMockFunctions",
        ":TestCommonStackConfig",
@@ -1309,6 +1314,7 @@ cc_test {
    ],
    srcs: [
        ":OsiCompatSources",
        ":TestCommonLogMsg",
        ":TestCommonMainHandler",
        ":TestCommonMockFunctions",
        ":TestCommonStackConfig",
@@ -1377,6 +1383,7 @@ cc_test {
        "packages/modules/Bluetooth/system/utils/include",
    ],
    srcs: [
        ":TestCommonLogMsg",
        ":TestCommonMockFunctions",
        ":TestMockBtif",
        ":TestMockOsi",
+0 −2
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@

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

void LogMsg(uint32_t trace_set_mask, const char* fmt_str, ...) {}

class StackGattTest : public ::testing::Test {};

namespace {
+0 −10
Original line number Diff line number Diff line
@@ -24,16 +24,6 @@

#include <string>

// Override LogMsg method so that we can output log via VLOG(1)
extern "C" void LogMsg(uint32_t trace_set_mask, const char* fmt_str, ...) {
  char buffer[256];
  va_list args;
  va_start(args, fmt_str);
  vsnprintf(buffer, 256, fmt_str, args);
  VLOG(1) << buffer;
  va_end(args);
}

int main(int argc, char** argv) {
  ::testing::InitGoogleTest(&argc, argv);

+0 −2
Original line number Diff line number Diff line
@@ -35,8 +35,6 @@ using testing::SetArrayArgument;
// Global trace level referred in the code under test
uint8_t appl_trace_level = BT_TRACE_LEVEL_VERBOSE;

extern "C" void LogMsg(uint32_t trace_set_mask, const char* fmt_str, ...) {}

namespace {
// convenience mock
class IopMock {
+0 −2
Original line number Diff line number Diff line
@@ -35,8 +35,6 @@

tBTM_CB btm_cb;

void LogMsg(uint32_t trace_set_mask, const char* fmt_str, ...) {}

namespace {
const char* test_flags[] = {
    "INIT_logging_debug_enabled_for_all=true",
Loading