ros2 / geometry2

A set of ROS packages for keeping track of coordinate transforms.
BSD 3-Clause "New" or "Revised" License
110 stars 193 forks source link

[cache_unittest] Add direct implementation testing on ordering, pruning (backport #678) #687

Closed mergify[bot] closed 1 month ago

mergify[bot] commented 1 month ago

Towards #676 This changes nothing pertaining to the implementation. It only adds testing. Some of it is implementation-specific, but towards the ends of performance checks.

From https://github.com/ros2/geometry2/issues/676#issuecomment-2102512107

  1. It needs to hold an arbitrary number of entries, because we don't know the rate at which we will get data.
  2. The items needs to be in sorted order by timestamp, from the newest entry to the oldest.
  3. New items need to be inserted into arbitrary positions, as timestamps may come in out-of-order.
  4. Duplicates shouldn't be allowed.
  5. Old items need to be pruned out.

To answer them:

  1. There appears to be no limit on size. Not sure how to test this in a bounded fashion.
  2. This was not tested. Now explicitly tested via ImplSortedDescendingUniqueEntries
  3. This was not tested. Now explicitly tested via ImplSortedDescendingUniqueEntries
  4. This was already tested, but is also explicitly tested via ImplSortedDescendingUniqueEntries
  5. This was not tested (I believe). Now explicitly tested via ImplSortedDescendingUniqueEntries
    This is an automatic backport of pull request #678 done by Mergify.