History log of /system/connectivity/wifilogd/tests/protocol_unittest.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fd08064ec7ca120b3501c341c8dfde9fdd757316 08-Oct-2016 mukesh agrawal <quiche@google.com> CommandProcessor: start dump implementation

Update CommandProcessor, to support dumping existing
logs. In order to keep the CL size reasonable, this
CL only implements dumping of the timestamps of each
message. Dumping the payload will be added in a follow-on
CL.

Note that the new unit tests use ::testing::Invoke(),
in a way that mixes the mocking and faking test
strategies in a single object. The GMock documentation
discourages this kind of mixing, in favor of splitting
a class into one piece that is to be mocked, and another
that is to be faked [1].

The reason we mix the strategies, despite the recommendation
to the contrary, is that we don't always want to fake
Os::Write(). Some times, we just want to mock that method.

Along the way:
- add a ScopedRewinder to MessageBuffer
- add the kDumpBuffers command to protocol::Opcode.
This command is numbered 0x20, to leave room for
addition kWrite<MessageType> commands.

[1]
https://github.com/google/googletest/blob/master/googlemock/docs/v1_6/CookBook.md
Specifically, "Having to mix a mock and a fake..."

Bug: 32098312
Test: ./runtests.sh
Change-Id: If221b47ae5615bbc114db5755ce9eb46b9934b6e
/system/connectivity/wifilogd/tests/protocol_unittest.cpp
6154ce7b95f2e77ec3e9c02d48746e592dcdcf54 23-Sep-2016 mukesh agrawal <quiche@google.com> protocol: add header and unit tests

Add a header file which provides a C++ definition of the
wifilogd protocol. Add unit tests for the same.

Note that we add only enough detail here to implement the
bits of wifilogd which log an ASCII message. Additional
details will be added later.

Bug: 31858296
Test: ./runtests.sh (on bullhead)
Change-Id: Ia16c57bf6f246e1834b893d5a1c9545d5ebb46f4
/system/connectivity/wifilogd/tests/protocol_unittest.cpp