History log of /system/chre/util/tests/dynamic_vector_test.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8be5eabe6a4fc60c56a3b32794bb6677e26f6eab 27-Mar-2017 Brian Duddie <bduddie@google.com> Fix incorrect usage of assignment, move in containers

Containers like DynamicVector were using the assignment operator in
multiple places to initialize memory. This is not valid, as assignment
assumes that the receiving object has already been constructed. This
manifested in use of DynamicVector<UniquePtr>, where UniquePtr's move
assignment operator would call memoryFree on its pointer if not null -
if its pointer was some non-zero uninitialized memory, this would lead
to memory corruption and a likely crash.

Resolve this issue by correcting all instances where assignment was used
on uninitialized memory to use placement new to properly construct these
objects. Also, make updates to places where containers assumed that
move/copy assignment/construction was supported by the contained type to
check that condition and select the appropriate option.

Finally, fix the tests that were written with the assumption that
certain operations would use assignment when they should have used
construction, and also increase overall test coverage to ensure this
issue does not recur.

Test: run tests and simulator with valgrind
Change-Id: Ia2803ab78a02065acab384e536c3259a52f7c863
/system/chre/util/tests/dynamic_vector_test.cc
7621b3267fd2ff1068d7aa7d75441d68646226ab 19-Mar-2017 Brian Duddie <bduddie@google.com> Reorganize HostProtocol, add hub info query

Split HostProtocol into three classes: one for the host, one for CHRE,
and one that's shared. Since the protocol is not fully symmetric (e.g.
messages to/from nanoapps are the same in both directions, but only one
side will ever request hub info, and only CHRE will ever construct the
response), this avoids pulling in unneeded code.

Also, add support for querying hub information from CHRE to be used in
the HAL, and rework the HostLink pending outbound message queue to be
more generic.

Test: run chre_test_client
Change-Id: Id88485b8c5a085eb886d4059840ac640c0383c88
/system/chre/util/tests/dynamic_vector_test.cc
30f18903edc1dfe46e12b9989760ef7a56cb31d3 02-Mar-2017 Andrew Rossignol <aarossig@google.com> Implements the chreWifiConfigureScanMonitorAsync CHRE API

Test: Compile only, WifiWorld will be extended next
Change-Id: Idb8a59ec7cbc2808fa08885ffdcd22b14b30d1b6
/system/chre/util/tests/dynamic_vector_test.cc
bbda86b265077ca90306c5f2e2590807daa39d55 02-Mar-2017 Brian Duddie <bduddie@google.com> Add DynamicVector::copy_array

Introduce new function to support populating a vector by copying
elements out of an existing array.

Change-Id: Ibf37eb48e54322f3723aa0e34930f57a3f744e6f
/system/chre/util/tests/dynamic_vector_test.cc
83be94436ec4d35296e00da877c7198f67b6af44 23-Feb-2017 Brian Duddie <bduddie@google.com> Add DynamicVector::front()

Change-Id: I1653105909346e1c659929effdcc11c9e5bd224d
/system/chre/util/tests/dynamic_vector_test.cc
4639307f24f079e7e465a3a17ca90bfac4372ad3 18-Feb-2017 Brian Duddie <bduddie@google.com> DynamicVector: Add clear(), wrap(), and unwrap()

Introduce the ability to wrap an existing buffer so it can be used as a
DynamicVector, plus unwrap to restore the vector to controlling its own
buffer, and add a function to erase all elements in the vector.

Also, refactor to avoid early return in existing functions.

Change-Id: Iee92dbf7ffbfb59615ea0a7bb8fb06740fd09dd4
/system/chre/util/tests/dynamic_vector_test.cc
bdeb899511e9431117d4d41315742757ea895225 03-Feb-2017 Andrew Rossignol <aarossig@google.com> Adds a move-assignment constructor to DynamicVector and test

Change-Id: Ibd1e83cbe299832abbe0502d2e8d5484cd6c9c82
/system/chre/util/tests/dynamic_vector_test.cc
e1129bcc6fb320fd1752cd6c900ead2a0595c761 28-Jan-2017 Meng-hsuan Chung <menghsuan@google.com> Iterators: rename const iterators

- Renamed const iterators to cbegin() and cend().
- Added comments for iterator invalidation
- Added iterator tests.

Change-Id: Ia10d33c64d0c543a2791dc93f875a641148298e1
/system/chre/util/tests/dynamic_vector_test.cc
90c04ef3564eb228eebb5da5b21bb80e5e46e299 13-Jan-2017 Meng-hsuan Chung <menghsuan@google.com> Iterator implementation

Added implementation for containers whose iterator can rely on pointer
arithmetics, which includes FixedSizeVector, DynamicVector and PriorityQueue.

Change-Id: Iee5b682fd093360e11ff47506d5cb21ff804ca21
/system/chre/util/tests/dynamic_vector_test.cc
8acb65434c74048a032a57f5321baeb028f6bdf3 10-Jan-2017 Andrew Rossignol <aarossig@google.com> Update DynamicVector to use std::move when possible

- Adds a test to verify the behavior.

Change-Id: I3250c2e1aac98aea44d8e1793536d5026fbae57d
/system/chre/util/tests/dynamic_vector_test.cc
c265103d508f74c2bec5fcdd42e960c044bb19c5 10-Jan-2017 Andrew Rossignol <aarossig@google.com> Adds a back() method to DynamicVector

Change-Id: I25660c2dedfecf2bce95f5d530cdab5178cfead1
/system/chre/util/tests/dynamic_vector_test.cc
12048259ea9203bccb00460b821a40731249f1e2 04-Jan-2017 Meng-hsuan Chung <menghsuan@google.com> Heap implementation

Functions inspired by std:push_heap and std:pop_heap are added.

Currently, they only work with FixedSizeVector and DynamicVector.
FixedSizeVector and DynamicVector are also modified to add support
for required methods.

Change-Id: Id05d3ad996ebe9cf8b0250f50da2bf031a7b6f82
/system/chre/util/tests/dynamic_vector_test.cc
f8d6e050ae7a17b5a96886135872d615d111a84a 22-Dec-2016 Andrew Rossignol <aarossig@google.com> Adds find() to DynamicVector

Change-Id: I707cf83aaaff71c5f37e839fbdf4feac82028537
/system/chre/util/tests/dynamic_vector_test.cc
ea9fd91360a23da4652a5c51eb2e909ff765fe9e 12-Dec-2016 Andrew Rossignol <aarossig@google.com> Adds support for erase to DynamicVector and a test

Change-Id: I2de7cffed676e7e8db482873f3092c43dd1438b8
/system/chre/util/tests/dynamic_vector_test.cc
3fe2daaded2dc07da1175e3d5655d7dd956a0ba9 12-Dec-2016 Andrew Rossignol <aarossig@google.com> Adds support for insert to DynamicVector and tests

Change-Id: If5b2d2a413a0aa190fedc454099e67af698466c5
/system/chre/util/tests/dynamic_vector_test.cc
3eaba1f8aa56dbc86fa8118d5314f97423cf5e84 08-Dec-2016 Andrew Rossignol <aarossig@google.com> Implements DynamicVector and adds tests

Change-Id: Ia27c6bce172c4f2b2a4d7db6378dc862a0644bf9
/system/chre/util/tests/dynamic_vector_test.cc
736620171d63e1f0c0be70f9c27e2679fca5eaad 25-Nov-2016 Andrew Rossignol <aarossig@google.com> Adds a FixedSizeVector and tests.

This provides the same API as the DynamicVector but uses statically
allocated storage.

Change-Id: Ie26245ebf0bce8d924413ba80bbc1b392b5e3309
/system/chre/util/tests/dynamic_vector_test.cc
e64f180233e64c40b56993cfea3696c5b4b16395 04-Nov-2016 Brian Duddie <bduddie@google.com> Initial import of CHRE source from external repo

Starting at commit 46a52e0 from contexthub-base.

Change-Id: I373f3a99b74757daae465b78a3d19bfce4770364
/system/chre/util/tests/dynamic_vector_test.cc