Loading system/stack/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -430,6 +430,7 @@ cc_fuzz { "BluetoothGeneratedDumpsysDataSchema_h", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestFakeOsi", Loading Loading @@ -483,6 +484,7 @@ cc_fuzz { "BluetoothGeneratedDumpsysDataSchema_h", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestFakeOsi", Loading Loading @@ -531,6 +533,7 @@ cc_fuzz { "BluetoothGeneratedDumpsysDataSchema_h", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestFakeOsi", Loading Loading @@ -574,6 +577,7 @@ cc_fuzz { "BluetoothGeneratedDumpsysDataSchema_h", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestFakeOsi", Loading Loading @@ -621,6 +625,7 @@ cc_fuzz { "BluetoothGeneratedDumpsysDataSchema_h", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestFakeOsi", Loading Loading @@ -1370,6 +1375,7 @@ cc_test { "packages/modules/Bluetooth/system/gd", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestMockMainShim", Loading system/test/mock/mock_osi_allocator.cc +16 −0 Original line number Diff line number Diff line Loading @@ -23,10 +23,26 @@ // Mock include file to share data between tests and mock #include "test/mock/mock_osi_allocator.h" #include "osi/include/allocator.h" #include "test/common/mock_functions.h" // Mocked internal structures, if any OsiObject::OsiObject(void* ptr) : ptr_(ptr) {} OsiObject::OsiObject(const void* ptr) : ptr_(const_cast<void*>(ptr)) {} OsiObject::~OsiObject() { if (ptr_ != nullptr) { osi_free(ptr_); } } void* OsiObject::Release() { void* ptr = ptr_; ptr_ = nullptr; return ptr; } namespace test { namespace mock { namespace osi_allocator { Loading system/test/stub/osi.cc +16 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,22 @@ #define UNUSED_ATTR #endif OsiObject::OsiObject(void* ptr) : ptr_(ptr) {} OsiObject::OsiObject(const void* ptr) : ptr_(const_cast<void*>(ptr)) {} OsiObject::~OsiObject() { if (ptr_ != nullptr) { osi_free(ptr_); } } void* OsiObject::Release() { void* ptr = ptr_; ptr_ = nullptr; return ptr; } struct StringComparison { bool operator()(char const* lhs, char const* rhs) const { return strcmp(lhs, rhs) < 0; Loading Loading
system/stack/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -430,6 +430,7 @@ cc_fuzz { "BluetoothGeneratedDumpsysDataSchema_h", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestFakeOsi", Loading Loading @@ -483,6 +484,7 @@ cc_fuzz { "BluetoothGeneratedDumpsysDataSchema_h", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestFakeOsi", Loading Loading @@ -531,6 +533,7 @@ cc_fuzz { "BluetoothGeneratedDumpsysDataSchema_h", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestFakeOsi", Loading Loading @@ -574,6 +577,7 @@ cc_fuzz { "BluetoothGeneratedDumpsysDataSchema_h", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestFakeOsi", Loading Loading @@ -621,6 +625,7 @@ cc_fuzz { "BluetoothGeneratedDumpsysDataSchema_h", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestFakeOsi", Loading Loading @@ -1370,6 +1375,7 @@ cc_test { "packages/modules/Bluetooth/system/gd", ], srcs: [ ":BluetoothPacketSources", ":TestCommonMockFunctions", ":TestCommonStackConfig", ":TestMockMainShim", Loading
system/test/mock/mock_osi_allocator.cc +16 −0 Original line number Diff line number Diff line Loading @@ -23,10 +23,26 @@ // Mock include file to share data between tests and mock #include "test/mock/mock_osi_allocator.h" #include "osi/include/allocator.h" #include "test/common/mock_functions.h" // Mocked internal structures, if any OsiObject::OsiObject(void* ptr) : ptr_(ptr) {} OsiObject::OsiObject(const void* ptr) : ptr_(const_cast<void*>(ptr)) {} OsiObject::~OsiObject() { if (ptr_ != nullptr) { osi_free(ptr_); } } void* OsiObject::Release() { void* ptr = ptr_; ptr_ = nullptr; return ptr; } namespace test { namespace mock { namespace osi_allocator { Loading
system/test/stub/osi.cc +16 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,22 @@ #define UNUSED_ATTR #endif OsiObject::OsiObject(void* ptr) : ptr_(ptr) {} OsiObject::OsiObject(const void* ptr) : ptr_(const_cast<void*>(ptr)) {} OsiObject::~OsiObject() { if (ptr_ != nullptr) { osi_free(ptr_); } } void* OsiObject::Release() { void* ptr = ptr_; ptr_ = nullptr; return ptr; } struct StringComparison { bool operator()(char const* lhs, char const* rhs) const { return strcmp(lhs, rhs) < 0; Loading