Skip to content

Commit

Permalink
pw_bluetooth_sapphire: Follow pigweed style for test files
Browse files Browse the repository at this point in the history
Fuchsia used `unittest` suffixes for its unit test files. Pigweed uses a
`test` suffix. This change updates the new `pw_bluetooth_sapphire`
module to use the Pigweed style.

Change-Id: I4479a094764d4544d0aea99a0c1a2a6fd972f1bd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/182012
Reviewed-by: Ben Lawson <[email protected]>
Commit-Queue: Faraaz Sareshwala <[email protected]>
  • Loading branch information
fsareshwala authored and CQ Bot Account committed Nov 21, 2023
1 parent a4b7366 commit 9e20465
Show file tree
Hide file tree
Showing 144 changed files with 258 additions and 258 deletions.
254 changes: 127 additions & 127 deletions pw_bluetooth_sapphire/BUILD.bazel

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions pw_bluetooth_sapphire/host/att/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ pw_source_set("att") {

pw_test("tests") {
sources = [
"attribute_unittest.cc",
"bearer_unittest.cc",
"database_unittest.cc",
"error_unittest.cc",
"permissions_unittest.cc",
"attribute_test.cc",
"bearer_test.cc",
"database_test.cc",
"error_test.cc",
"permissions_test.cc",
]

deps = [
Expand Down
38 changes: 19 additions & 19 deletions pw_bluetooth_sapphire/host/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,25 @@ pw_source_set("common") {

pw_test("common_tests") {
sources = [
"advertising_data_unittest.cc",
"bounded_inspect_list_node_unittest.cc",
"byte_buffer_unittest.cc",
"device_address_unittest.cc",
"device_class_unittest.cc",
"error_unittest.cc",
"expiring_set_unittest.cc",
"identifier_unittest.cc",
"inspectable_unittest.cc",
"manufacturer_names_unittest.cc",
"metrics_unittest.cc",
"packet_view_unittest.cc",
"pipeline_monitor_unittest.cc",
"retire_log_unittest.cc",
"slab_allocator_unittest.cc",
"supplement_data_unittest.cc",
"uuid_unittest.cc",
"weak_self_unittest.cc",
"windowed_inspect_numeric_property_unittest.cc",
"advertising_data_test.cc",
"bounded_inspect_list_node_test.cc",
"byte_buffer_test.cc",
"device_address_test.cc",
"device_class_test.cc",
"error_test.cc",
"expiring_set_test.cc",
"identifier_test.cc",
"inspectable_test.cc",
"manufacturer_names_test.cc",
"metrics_test.cc",
"packet_view_test.cc",
"pipeline_monitor_test.cc",
"retire_log_test.cc",
"slab_allocator_test.cc",
"supplement_data_test.cc",
"uuid_test.cc",
"weak_self_test.cc",
"windowed_inspect_numeric_property_test.cc",
]

deps = [
Expand Down
36 changes: 18 additions & 18 deletions pw_bluetooth_sapphire/host/gap/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,24 @@ pw_source_set("testing") {

pw_test("gap_tests") {
sources = [
"adapter_unittest.cc",
"android_vendor_capabilities_unittest.cc",
"bredr_connection_manager_unittest.cc",
"bredr_connection_request_unittest.cc",
"bredr_discovery_manager_unittest.cc",
"bredr_interrogator_unittest.cc",
"discovery_filter_unittest.cc",
"fake_pairing_delegate_unittest.cc",
"identity_resolving_list_unittest.cc",
"low_energy_address_manager_unittest.cc",
"low_energy_advertising_manager_unittest.cc",
"low_energy_connection_manager_unittest.cc",
"low_energy_discovery_manager_unittest.cc",
"low_energy_interrogator_unittest.cc",
"pairing_state_unittest.cc",
"peer_cache_unittest.cc",
"peer_unittest.cc",
"types_unittest.cc",
"adapter_test.cc",
"android_vendor_capabilities_test.cc",
"bredr_connection_manager_test.cc",
"bredr_connection_request_test.cc",
"bredr_discovery_manager_test.cc",
"bredr_interrogator_test.cc",
"discovery_filter_test.cc",
"fake_pairing_delegate_test.cc",
"identity_resolving_list_test.cc",
"low_energy_address_manager_test.cc",
"low_energy_advertising_manager_test.cc",
"low_energy_connection_manager_test.cc",
"low_energy_discovery_manager_test.cc",
"low_energy_interrogator_test.cc",
"pairing_state_test.cc",
"peer_cache_test.cc",
"peer_test.cc",
"types_test.cc",
]

deps = [
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions pw_bluetooth_sapphire/host/gatt/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ pw_source_set("testing") {

pw_test("tests") {
sources = [
"client_unittest.cc",
"gatt_unittest.cc",
"generic_attribute_service_unittest.cc",
"local_service_manager_unittest.cc",
"remote_service_manager_unittest.cc",
"server_unittest.cc",
"client_test.cc",
"gatt_test.cc",
"generic_attribute_service_test.cc",
"local_service_manager_test.cc",
"remote_service_manager_test.cc",
"server_test.cc",
]

deps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2478,7 +2478,7 @@ TEST_F(RemoteServiceManagerTest, ReadDescSendsReadRequest) {
// TODO(armansito): Some of the service set up and |status| verification
// boilerplate could be reduced by factoring them out into helpers on the test
// harness (also see code review comment in
// https://fuchsia-review.googlesource.com/c/garnet/+/213794/6/drivers/bluetooth/lib/gatt/remote_service_manager_unittest.cc).
// https://fuchsia-review.googlesource.com/c/garnet/+/213794/6/drivers/bluetooth/lib/gatt/remote_service_manager_test.cc).
constexpr att::Handle kValueHandle1 = 3;
constexpr att::Handle kValueHandle2 = 5;
constexpr att::Handle kDescrHandle = 6;
Expand Down
2 changes: 1 addition & 1 deletion pw_bluetooth_sapphire/host/hci-spec/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pw_source_set("hci-spec") {
}

pw_test("tests") {
sources = [ "util_unittest.cc" ]
sources = [ "util_test.cc" ]

deps = [ ":hci-spec" ]

Expand Down
24 changes: 12 additions & 12 deletions pw_bluetooth_sapphire/host/hci/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ pw_source_set("testing") {

pw_test("tests") {
sources = [
"advertising_handle_map_unittest.cc",
"advertising_report_parser_unittest.cc",
"command_handler_unittest.cc",
"connection_unittest.cc",
"extended_low_energy_advertiser_unittest.cc",
"legacy_low_energy_advertiser_unittest.cc",
"legacy_low_energy_scanner_unittest.cc",
"low_energy_advertiser_unittest.cc",
"low_energy_connector_unittest.cc",
"low_energy_multiple_advertising_unittest.cc",
"sequential_command_runner_unittest.cc",
"util_unittest.cc",
"advertising_handle_map_test.cc",
"advertising_report_parser_test.cc",
"command_handler_test.cc",
"connection_test.cc",
"extended_low_energy_advertiser_test.cc",
"legacy_low_energy_advertiser_test.cc",
"legacy_low_energy_scanner_test.cc",
"low_energy_advertiser_test.cc",
"low_energy_connector_test.cc",
"low_energy_multiple_advertising_test.cc",
"sequential_command_runner_test.cc",
"util_test.cc",
]

deps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ TEST_F(LegacyLowEnergyAdvertiserTest, StartAdvertisingReadTxPowerFails) {

// TODO(fsareshwala): This test should really belong in LowEnergyAdvertiser's
// unittest file
// ($dir_pw_bluetooth_sapphire/host/hci/low_energy_advertiser_unittest.cc)
// ($dir_pw_bluetooth_sapphire/host/hci/low_energy_advertiser_test.cc)
// because all low energy advertisers should follow this convention. However,
// this requires that all low energy advertisers implement random address
// rotation. Currently, the only other low energy advertiser is the
Expand Down
File renamed without changes.
50 changes: 25 additions & 25 deletions pw_bluetooth_sapphire/host/l2cap/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -147,31 +147,31 @@ pw_source_set("testing") {

pw_test("l2cap_tests") {
sources = [
"a2dp_offload_manager_unittest.cc",
"basic_mode_rx_engine_unittest.cc",
"basic_mode_tx_engine_unittest.cc",
"bredr_command_handler_unittest.cc",
"bredr_dynamic_channel_unittest.cc",
"bredr_signaling_channel_unittest.cc",
"channel_configuration_unittest.cc",
"channel_manager_unittest.cc",
"channel_unittest.cc",
"command_handler_unittest.cc",
"dynamic_channel_registry_unittest.cc",
"enhanced_retransmission_mode_engines_unittest.cc",
"enhanced_retransmission_mode_rx_engine_unittest.cc",
"enhanced_retransmission_mode_tx_engine_unittest.cc",
"fcs_unittest.cc",
"fragmenter_unittest.cc",
"frame_headers_unittest.cc",
"le_signaling_channel_unittest.cc",
"logical_link_unittest.cc",
"low_energy_command_handler_unittest.cc",
"pdu_unittest.cc",
"recombiner_unittest.cc",
"scoped_channel_unittest.cc",
"signaling_channel_unittest.cc",
"types_unittest.cc",
"a2dp_offload_manager_test.cc",
"basic_mode_rx_engine_test.cc",
"basic_mode_tx_engine_test.cc",
"bredr_command_handler_test.cc",
"bredr_dynamic_channel_test.cc",
"bredr_signaling_channel_test.cc",
"channel_configuration_test.cc",
"channel_manager_test.cc",
"channel_test.cc",
"command_handler_test.cc",
"dynamic_channel_registry_test.cc",
"enhanced_retransmission_mode_engines_test.cc",
"enhanced_retransmission_mode_rx_engine_test.cc",
"enhanced_retransmission_mode_tx_engine_test.cc",
"fcs_test.cc",
"fragmenter_test.cc",
"frame_headers_test.cc",
"le_signaling_channel_test.cc",
"logical_link_test.cc",
"low_energy_command_handler_test.cc",
"pdu_test.cc",
"recombiner_test.cc",
"scoped_channel_test.cc",
"signaling_channel_test.cc",
"types_test.cc",
]

deps = [
Expand Down
4 changes: 2 additions & 2 deletions pw_bluetooth_sapphire/host/sco/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ pw_source_set("sco") {

pw_test("tests") {
sources = [
"sco_connection_manager_unittest.cc",
"sco_connection_unittest.cc",
"sco_connection_manager_test.cc",
"sco_connection_test.cc",
]

deps = [
Expand Down
12 changes: 6 additions & 6 deletions pw_bluetooth_sapphire/host/sdp/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ pw_source_set("sdp") {

pw_test("sdp_tests") {
sources = [
"client_unittest.cc",
"data_element_unittest.cc",
"pdu_unittest.cc",
"server_unittest.cc",
"service_discoverer_unittest.cc",
"service_record_unittest.cc",
"client_test.cc",
"data_element_test.cc",
"pdu_test.cc",
"server_test.cc",
"service_discoverer_test.cc",
"service_record_test.cc",
]

deps = [
Expand Down
File renamed without changes.
30 changes: 15 additions & 15 deletions pw_bluetooth_sapphire/host/sm/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@ pw_source_set("testing") {

pw_test("sm_tests") {
sources = [
"ecdh_key_unittest.cc",
"error_unittest.cc",
"packet_unittest.cc",
"pairing_channel_unittest.cc",
"pairing_phase_unittest.cc",
"phase_1_unittest.cc",
"phase_2_legacy_unittest.cc",
"phase_2_secure_connections_unittest.cc",
"phase_3_unittest.cc",
"sc_stage_1_just_works_numeric_comparison_unittest.cc",
"sc_stage_1_passkey_unittest.cc",
"security_manager_unittest.cc",
"security_request_phase_unittest.cc",
"types_unittest.cc",
"util_unittest.cc",
"ecdh_key_test.cc",
"error_test.cc",
"packet_test.cc",
"pairing_channel_test.cc",
"pairing_phase_test.cc",
"phase_1_test.cc",
"phase_2_legacy_test.cc",
"phase_2_secure_connections_test.cc",
"phase_3_test.cc",
"sc_stage_1_just_works_numeric_comparison_test.cc",
"sc_stage_1_passkey_test.cc",
"security_manager_test.cc",
"security_request_phase_test.cc",
"types_test.cc",
"util_test.cc",
]

deps = [
Expand Down
2 changes: 1 addition & 1 deletion pw_bluetooth_sapphire/host/sm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ These files provide commonly-used functionality in SM. They easily could be (and
* [`util.h`](/src/connectivity/bluetooth/core/bt-host/sm/util.h) - cryptographic primitives and other pure-function utilities used in the SMP stack.

#### Test files:
Besides the `bt-host` standard `<source_file_stem>_unittest.cc` files, SM provides the following test helpers:
Besides the `bt-host` standard `<source_file_stem>_test.cc` files, SM provides the following test helpers:
* [`TestSecurityManager(Factory)`](/src/connectivity/bluetooth/core/bt-host/sm/test_security_manager.h) - a test implementation of SM's public interface, `SecurityManager`. Provides a `TestSecurityManagerFactory` with a `CreateSm` method which stores a reference to the created `TestSecurityManager`. A `TestSecurityManagerFactory` can be used to inject `TestSecurityManager`s into production code while keeping them accessible by unit tests. The current implementation is a very minimal test spy. It provides basic argument snooping and stub responses for a few methods and noop implementations for others. More functionality may be added as necessary to expand test coverage of SM-dependent code.
* [`FakeListener`](/src/connectivity/bluetooth/core/bt-host/sm/fake_phase_listener.h) - fakes an implementation of the `PairingPhase::Listener` interface, which the `PairingPhase` subclasses require for unit testing.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions pw_bluetooth_sapphire/host/testing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ pw_source_set("test_helpers") {

pw_test("tests") {
sources = [
"fake_controller_unittest.cc",
"fake_dynamic_channel_unittest.cc",
"fake_l2cap_unittest.cc",
"fake_sdp_server_unittest.cc",
"fake_signaling_server_unittest.cc",
"inspect_util_unittest.cc",
"parse_args_unittest.cc",
"fake_controller_test.cc",
"fake_dynamic_channel_test.cc",
"fake_l2cap_test.cc",
"fake_sdp_server_test.cc",
"fake_signaling_server_test.cc",
"inspect_util_test.cc",
"parse_args_test.cc",
]

deps = [
Expand Down
18 changes: 9 additions & 9 deletions pw_bluetooth_sapphire/host/transport/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ pw_source_set("testing") {

pw_test("tests") {
sources = [
"acl_data_channel_unittest.cc",
"command_channel_unittest.cc",
"emboss_control_packets_unittest.cc",
"emboss_packet_unittest.cc",
"packet_unittest.cc",
"sco_data_channel_unittest.cc",
"sco_data_packet_unittest.cc",
"slab_allocators_unittest.cc",
"transport_unittest.cc",
"acl_data_channel_test.cc",
"command_channel_test.cc",
"emboss_control_packets_test.cc",
"emboss_packet_test.cc",
"packet_test.cc",
"sco_data_channel_test.cc",
"sco_data_packet_test.cc",
"slab_allocators_test.cc",
"transport_test.cc",
]

deps = [
Expand Down
2 changes: 1 addition & 1 deletion pw_bluetooth_sapphire/lib/cpp-string/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pw_source_set("cpp-string") {
pw_test("string_printf_test") {
enable_if = current_os != "win" && dir_pw_third_party_icu != ""

sources = [ "string_printf_unittest.cc" ]
sources = [ "string_printf_test.cc" ]

cflags = [ "-Wno-format-zero-length" ]

Expand Down
4 changes: 2 additions & 2 deletions pw_bluetooth_sapphire/lib/cpp-type/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ pw_source_set("cpp-type") {

pw_test("type_test") {
sources = [
"member_pointer_traits_unittest.cc",
"to_std_array_unittest.cc",
"member_pointer_traits_test.cc",
"to_std_array_test.cc",
]

deps = [ ":cpp-type" ]
Expand Down

0 comments on commit 9e20465

Please sign in to comment.