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

Commit 5321e8ce authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Clean up unused param warnings fuzz tests am: 3559f8fa

parents 2a580355 3559f8fa
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -30,9 +30,9 @@ class FuzzHciHal : public HciHal {
  void unregisterIncomingPacketCallback() override;

  void sendHciCommand(HciPacket command) override;
  void sendAclData(HciPacket packet) override {}
  void sendScoData(HciPacket packet) override {}
  void sendIsoData(HciPacket packet) override {}
  void sendAclData(HciPacket /* packet */) override {}
  void sendScoData(HciPacket /* packet */) override {}
  void sendIsoData(HciPacket /* packet */) override {}

  void injectArbitrary(FuzzedDataProvider& fdp);

@@ -43,7 +43,7 @@ class FuzzHciHal : public HciHal {
  static const ModuleFactory Factory;

 protected:
  void ListDependencies(ModuleList* list) const override {}
  void ListDependencies(ModuleList* /* list */) const override {}
  void Start() override {}
  void Stop() override {}

+26 −16
Original line number Diff line number Diff line
@@ -25,49 +25,59 @@ using bluetooth::common::ContextualCallback;
using bluetooth::fuzz::GetArbitraryBytes;
using bluetooth::fuzz::InvokeIfValid;

hci::SecurityInterface* FuzzHciLayer::GetSecurityInterface(ContextualCallback<void(hci::EventView)> event_handler) {
hci::SecurityInterface* FuzzHciLayer::GetSecurityInterface(
    ContextualCallback<void(hci::EventView)> /* event_handler */) {
  return &security_interface_;
}

hci::LeSecurityInterface* FuzzHciLayer::GetLeSecurityInterface(
    ContextualCallback<void(hci::LeMetaEventView)> event_handler) {
    ContextualCallback<void(hci::LeMetaEventView)> /* event_handler */) {
  return &le_security_interface_;
}

hci::AclConnectionInterface* FuzzHciLayer::GetAclConnectionInterface(
    ContextualCallback<void(hci::EventView)> event_handler,
    ContextualCallback<void(uint16_t, hci::ErrorCode)> on_disconnect,
    ContextualCallback<
        void(hci::ErrorCode, uint16_t, uint8_t version, uint16_t manufacturer_name, uint16_t sub_version)>
        on_read_remote_version) {
    ContextualCallback<void(hci::EventView)> /* event_handler */,
    ContextualCallback<void(uint16_t, hci::ErrorCode)> /* on_disconnect */,
    ContextualCallback<void(
        hci::ErrorCode,
        uint16_t,
        uint8_t version,
        uint16_t manufacturer_name,
        uint16_t sub_version)>
    /* on_read_remote_version */) {
  return &acl_connection_interface_;
}

hci::LeAclConnectionInterface* FuzzHciLayer::GetLeAclConnectionInterface(
    ContextualCallback<void(hci::LeMetaEventView)> event_handler,
    ContextualCallback<void(uint16_t, hci::ErrorCode)> on_disconnect,
    ContextualCallback<
        void(hci::ErrorCode, uint16_t, uint8_t version, uint16_t manufacturer_name, uint16_t sub_version)>
        on_read_remote_version) {
    ContextualCallback<void(hci::LeMetaEventView)> /* event_handler */,
    ContextualCallback<void(uint16_t, hci::ErrorCode)> /* on_disconnect */,
    ContextualCallback<void(
        hci::ErrorCode,
        uint16_t,
        uint8_t version,
        uint16_t manufacturer_name,
        uint16_t sub_version)>
    /* on_read_remote_version */) {
  return &le_acl_connection_interface_;
}

hci::LeAdvertisingInterface* FuzzHciLayer::GetLeAdvertisingInterface(
    ContextualCallback<void(hci::LeMetaEventView)> event_handler) {
    ContextualCallback<void(hci::LeMetaEventView)> /* event_handler */) {
  return &le_advertising_interface_;
}

hci::LeScanningInterface* FuzzHciLayer::GetLeScanningInterface(
    ContextualCallback<void(hci::LeMetaEventView)> event_handler) {
    ContextualCallback<void(hci::LeMetaEventView)> /* event_handler */) {
  return &le_scanning_interface_;
}

hci::LeIsoInterface* FuzzHciLayer::GetLeIsoInterface(ContextualCallback<void(hci::LeMetaEventView)> event_handler) {
hci::LeIsoInterface* FuzzHciLayer::GetLeIsoInterface(
    ContextualCallback<void(hci::LeMetaEventView)> /* event_handler */) {
  return &le_iso_interface_;
}

hci::DistanceMeasurementInterface* FuzzHciLayer::GetDistanceMeasurementInterface(
    ContextualCallback<void(hci::LeMetaEventView)> event_handler) {
    ContextualCallback<void(hci::LeMetaEventView)> /* event_handler */) {
  return &distance_measurement_interface_;
}

+9 −7
Original line number Diff line number Diff line
@@ -32,11 +32,13 @@ namespace fuzz {
template <typename T>
class FuzzCommandInterface : public CommandInterface<T> {
 public:
  void EnqueueCommand(std::unique_ptr<T> command,
                      common::ContextualOnceCallback<void(hci::CommandCompleteView)> on_complete) override {}
  void EnqueueCommand(
      std::unique_ptr<T> /* command */,
      common::ContextualOnceCallback<void(hci::CommandCompleteView)> /* on_complete */) override {}

  void EnqueueCommand(std::unique_ptr<T> command,
                      common::ContextualOnceCallback<void(hci::CommandStatusView)> on_status) override {}
  void EnqueueCommand(
      std::unique_ptr<T> /* command */,
      common::ContextualOnceCallback<void(hci::CommandStatusView)> /* on_status */) override {}
};

class FuzzHciLayer : public HciLayer {
@@ -50,7 +52,7 @@ class FuzzHciLayer : public HciLayer {
  }

  void EnqueueCommand(
      std::unique_ptr<hci::CommandBuilder> command,
      std::unique_ptr<hci::CommandBuilder> /* command */,
      common::ContextualOnceCallback<void(hci::CommandCompleteView)> on_complete) override {
    on_command_complete_ = std::move(on_complete);
    if (auto_reply_fdp != nullptr) {
@@ -59,7 +61,7 @@ class FuzzHciLayer : public HciLayer {
  }

  void EnqueueCommand(
      std::unique_ptr<CommandBuilder> command,
      std::unique_ptr<CommandBuilder> /* command */,
      common::ContextualOnceCallback<void(hci::CommandStatusView)> on_status) override {
    on_command_status_ = std::move(on_status);
    if (auto_reply_fdp != nullptr) {
@@ -141,7 +143,7 @@ class FuzzHciLayer : public HciLayer {
  static const ModuleFactory Factory;

 protected:
  void ListDependencies(ModuleList* list) const override {}
  void ListDependencies(ModuleList* /* list */) const override {}
  void Start() override;
  void Stop() override;

+6 −4
Original line number Diff line number Diff line
@@ -68,11 +68,13 @@ class HciLayerFuzzClient : public Module {
    }

    if (uses_command_status(commandPacket.GetOpCode())) {
      interface->EnqueueCommand(TBUILDER::FromView(commandPacket),
                                GetHandler()->BindOnce([](CommandStatusView status) {}));
      interface->EnqueueCommand(
          TBUILDER::FromView(commandPacket),
          GetHandler()->BindOnce([](CommandStatusView /* status */) {}));
    } else {
      interface->EnqueueCommand(TBUILDER::FromView(commandPacket),
                                GetHandler()->BindOnce([](CommandCompleteView status) {}));
      interface->EnqueueCommand(
          TBUILDER::FromView(commandPacket),
          GetHandler()->BindOnce([](CommandCompleteView /* status */) {}));
    }
  }