test: runtime common return mode#451
Conversation
Signed-off-by: David Wong <david.wong@tier4.jp>
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #451 +/- ##
==========================================
+ Coverage 40.16% 40.52% +0.35%
==========================================
Files 131 131
Lines 10280 10259 -21
Branches 5387 5387
==========================================
+ Hits 4129 4157 +28
+ Misses 3770 3735 -35
+ Partials 2381 2367 -14
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| {ReturnMode::SINGLE_FIRST, "SingleFirst"}, | ||
| {ReturnMode::SINGLE_STRONGEST, "SingleStrongest"}, | ||
| {ReturnMode::SINGLE_LAST, "SingleLast"}, | ||
| {ReturnMode::DUAL_ONLY, "Dual"}, |
There was a problem hiding this comment.
dual is not a well-defined return mode, and does not correspond to a specific dual return setting. Currently, conventions seem to align across vendors, but I'd like it to be represented as a specific, e.g. LastStrongest option internally, or for it to be deprecated.
There was a problem hiding this comment.
I've done a bit of a refactor of return modes because previously types and modes were being confused.
This also leads to some vendor-specific edits and documentation changes. Please have a look and check that you agree - biggest design decision is how to consider the difference between "StrongestLast" and "LastStrongest". I chose to ignore the UDP field order in the concept of return mode, but kept compatibility with the old canonical strings.
| using nebula::drivers::return_mode_from_string; | ||
| using nebula::drivers::ReturnMode; | ||
|
|
||
| TEST(TestCoreTypes, ReturnModeRoundTrip) |
There was a problem hiding this comment.
Cases are not exhaustive, please add all return modes we want to support.
| EXPECT_EQ(return_mode_from_string("DualOnly"), ReturnMode::UNKNOWN); | ||
| EXPECT_EQ(return_mode_from_string("LastStrongest"), ReturnMode::UNKNOWN); | ||
| EXPECT_EQ(return_mode_from_string("FirstStrongest"), ReturnMode::UNKNOWN); | ||
| EXPECT_EQ(return_mode_from_string("Unknown"), ReturnMode::UNKNOWN); |
There was a problem hiding this comment.
Why are these UNKNOWN? Shouldn't they be valid?
Signed-off-by: David Wong <david.wong@tier4.jp>
Signed-off-by: David Wong <david.wong@tier4.jp>
Signed-off-by: David Wong <david.wong@tier4.jp>
Signed-off-by: David Wong <david.wong@tier4.jp>
e51efbd to
4b5900c
Compare
Signed-off-by: David Wong <david.wong@tier4.jp>
PR 1 of 8: Cover Generic Return Mode Parsing
Tracked by #452
Branch:
test/runtime-common-return-modeBase:
mainType: Improvement
Description
Adds a focused regression test for the generic
ReturnModestring contract innebula_core_common.This PR intentionally does not change runtime behavior. It documents the current
contract that only generic return mode names are parsed by
return_mode_from_string(), while vendor-specific combinations such asLastStrongestandFirstStrongestremain vendor-owned and returnUNKNOWNatthe common layer.
Review Procedure
Review only:
src/nebula_core/nebula_core_common/CMakeLists.txtsrc/nebula_core/nebula_core_common/test/test_core_types.cppConfirm that the new test target is minimal and does not introduce vendor or
runtime dependencies.
Covered Validation
colcon build --packages-select nebula_core_common --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfoNotes
This PR is a test-only base for the stack. It does not add vendor-neutral runtime
interfaces or vendor driver support.