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

Commit b67f8bba authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi Committed by Abhishek Pandit-Subedi
Browse files

floss: Fix rust test errors

Fix some build and runtime errors in Rust unit tests. Gatt was missing
some trait implementations and dbus macros had a non-compiling rustdoc.

Bug: 200411486
Tag: #floss
Test: ./build.py --target test
Change-Id: I86194a1cff7093e84287b30379f30da479e29f74
parent a5d8025b
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -33,9 +33,7 @@ pub fn dbus_method(_attr: TokenStream, item: TokenStream) -> TokenStream {
/// Generates a function to export a Rust object to D-Bus.
///
/// Example:
/// ```
///   #[generate_dbus_exporter(export_foo_dbus_obj, "org.example.FooInterface")]
/// ```
///
/// This generates a method called `export_foo_dbus_obj` that will export a Rust object into a
/// D-Bus object having interface `org.example.FooInterface`.
+54 −0
Original line number Diff line number Diff line
@@ -1359,6 +1359,60 @@ mod tests {
            _addr: String,
        ) {
        }

        fn on_phy_update(
            &self,
            _addr: String,
            _tx_phy: LePhy,
            _rx_phy: LePhy,
            _status: GattStatus,
        ) {
        }

        fn on_phy_read(&self, _addr: String, _tx_phy: LePhy, _rx_phy: LePhy, _status: GattStatus) {}

        fn on_search_complete(
            &self,
            _addr: String,
            _services: Vec<BluetoothGattService>,
            _status: i32,
        ) {
        }

        fn on_characteristic_read(
            &self,
            _addr: String,
            _status: i32,
            _handle: i32,
            _value: Vec<u8>,
        ) {
        }

        fn on_characteristic_write(&self, _addr: String, _status: i32, _handle: i32) {}

        fn on_execute_write(&self, _addr: String, _status: i32) {}

        fn on_descriptor_read(&self, _addr: String, _status: i32, _handle: i32, _value: Vec<u8>) {}

        fn on_descriptor_write(&self, _addr: String, _status: i32, _handle: i32) {}

        fn on_notify(&self, _addr: String, _handle: i32, _value: Vec<u8>) {}

        fn on_read_remote_rssi(&self, _addr: String, _rssi: i32, _status: i32) {}

        fn on_configure_mtu(&self, _addr: String, _mtu: i32, _status: i32) {}

        fn on_connection_updated(
            &self,
            _addr: String,
            _interval: i32,
            _latency: i32,
            _timeout: i32,
            _status: i32,
        ) {
        }

        fn on_service_changed(&self, _addr: String) {}
    }

    impl RPCProxy for TestBluetoothGattCallback {