uwb_core: verify the mock instance at the current thread
Originally, we verify the mock instance that all the expected calls
are called when the mock instance is dropped. However, the mock
instance are dropped at different thread. The panic doesn't propagate
to the testing thread correctly.
This CL changes the expected calls to Arc<Mutex<T>>, and adds
MockInstanceVerifier struct to share the expected callls. With this
struct, we could verify the mock instance at the current thread.
Bug: 228136039
Test: cargo test -p uwb_core
Test: Add unnecessary expected calls and make sure "cargo test" fails
Change-Id: I7f4579a4f9ca2fb3007791bfc7e466741c49ad1a
4 files changed