4 Commits

Author SHA1 Message Date
Yi Jin
18678bdca0 Empty output if compact fails.
There must be equal number of start/end calls with right token given in
order, if used in wrong order, ProtoOutputStream will have empty output.

Also refactor Android.bp, so the gtest is standalone unit test, it used
to require compile/push libprotoutil.so to device.

Bug: 77342154
Test: atest libprotoutil_test
Change-Id: I0011bbab34c04cb38164d2ed21cd818d52a2ecf9
2018-04-27 14:16:50 -07:00
Yi Jin
fd2a4c791e Use c++ template to reduce duped code.
Bug: 77342154
Test: atest libprotoutil_test
Change-Id: I6cf165c2214a8a627722a156b7498d0d8f5d1e18
2018-04-26 14:28:12 -07:00
Yi Jin
c3d4b28a76 Add unit tests to libprotoutil.
Bug: 77342154
Test: atest libprotoutil_test
Change-Id: I57f31f5cf83b635b200a93cbc655fac7f5edfbd5
2018-04-26 12:00:46 -07:00
Yi Jin
ad3e6e5d5a This cl tries to fix cts tests IncidentdTest
1. Disable BatteryType section which is device-specific
2. Make timeout longer since meminfo section timedout in test
3. make some negative values sint
4. varint can be 64 bits, there is a bug implicitly convert it to 32
which loses values.
5. Found another bug which failed to read 64 bits varint, create a
native test to make sure it works.

Bug: 77291057
Test: atest CtsIncidentHostTestCases:com.android.server.cts.IncidentdTest
Change-Id: I04cc730741f7901f37ac57a11af7777d57118a23
2018-04-04 16:29:55 -07:00