Commit Graph

2 Commits (feature-bluetooth-unit-test)

Author SHA1 Message Date
Vincent Coubard 0feaae6d18 Add fake implementation for GattServerMock::addService.
It is not easy to write expectations for this function:
- The data in input is a complex tree that is not comparable.
- The data in input is modified: The attributes of each element of
the tree is added by the server.

To ease test, a default implementation has been added but it is
still possible to override it or set expectations.
That default implementation set unique attribute handles for
each element of the service and _copy_ it in the GattServerMock.

The copy does *not* follow standard BLE API, it is a _POD_ where
each element of the object is accessible as a field. Childs are
stored in vector to ease iteration and memory management.

The representation of the services registered into the mock are
accessible in GattServerMock::services.
2021-02-10 11:26:25 +00:00
Paul Szczepanek 164bb83274
Add Bluetooth stubs as libs (#14229)
* add stubs as libs

* split up stubs and fakes

* use correct types in fake event queue

* allow arguments in fake event queue callbacks

* remove dispatch forever

* remove redundant call signature

* return false on cancel with invalid id

* return queue size
2021-02-09 14:52:30 +00:00