From ab6a940be362de19e1d58646cce90962670dcad3 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Thu, 6 May 2021 17:35:37 -0700 Subject: [PATCH] Introduce stack_gatt_test Bug: 183374320 Test: gd/cert/run Tag: #refactor Change-Id: I61ebf28260bdda015e8e826bd3fb9d91cef747ea --- stack/Android.bp | 71 ++++++++++++++++++++++++++++++++++++++ stack/test/gatt/stack_gatt_test.cc | 32 +++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 stack/test/gatt/stack_gatt_test.cc diff --git a/stack/Android.bp b/stack/Android.bp index 1c70760d8..1df95159f 100644 --- a/stack/Android.bp +++ b/stack/Android.bp @@ -911,3 +911,74 @@ cc_test { }, }, } + +cc_test { + name: "net_test_stack_gatt", + test_suites: ["device-tests"], + host_supported: true, + defaults: ["fluoride_defaults"], + local_include_dirs: [ + "include", + "test/common", + ], + include_dirs: [ + "system/bt", + "system/bt/gd", + "system/bt/utils/include", + ], + generated_headers: [ + "BluetoothGeneratedBundlerSchema_h_bfbs", + "BluetoothGeneratedDumpsysDataSchema_h", + "BluetoothGeneratedPackets_h", + ], + srcs: [ + ":TestMockBta", + ":TestMockBtif", + ":TestMockHci", + ":TestMockLegacyHciCommands", + ":TestMockMainShim", + ":TestMockStackAcl", + ":TestMockStackCryptotoolbox", + ":TestMockStackSmp", + ":TestStackBtm", + ":TestStackL2cap", + ":TestStackSdp", + "eatt/eatt.cc", + "gatt/att_protocol.cc", + "gatt/connection_manager.cc", + "gatt/gatt_api.cc", + "gatt/gatt_attr.cc", + "gatt/gatt_auth.cc", + "gatt/gatt_cl.cc", + "gatt/gatt_db.cc", + "gatt/gatt_main.cc", + "gatt/gatt_sr.cc", + "gatt/gatt_sr_hash.cc", + "gatt/gatt_utils.cc", + "test/gatt/stack_gatt_test.cc", + ], + static_libs: [ + "libbt-common", + "libbt-protos-lite", + "libbtdevice", + "libgmock", + "liblog", + "libosi", + ], + shared_libs: [ + "libbinder_ndk", + "libcrypto", + "libflatbuffers-cpp", + "libprotobuf-cpp-lite", + ], + sanitize: { + address: true, + all_undefined: true, + cfi: true, + integer_overflow: true, + scs: true, + diag: { + undefined : true + }, + }, +} diff --git a/stack/test/gatt/stack_gatt_test.cc b/stack/test/gatt/stack_gatt_test.cc new file mode 100644 index 000000000..7fca4cb71 --- /dev/null +++ b/stack/test/gatt/stack_gatt_test.cc @@ -0,0 +1,32 @@ +/* + * Copyright 2021 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. + */ + +#include +#include +#include +#include + +#include "common/message_loop_thread.h" + +std::map mock_function_count_map; + +void LogMsg(uint32_t trace_set_mask, const char* fmt_str, ...) {} + +bluetooth::common::MessageLoopThread* get_main_thread() { return nullptr; } + +class StackGattTest : public ::testing::Test {}; + +TEST_F(StackGattTest, nop) {} -- 2.11.0