fix: correct ASSERT_EQ to ASSERT_NE in admittance controller load test#2264
fix: correct ASSERT_EQ to ASSERT_NE in admittance controller load test#2264SouriRishik wants to merge 4 commits intoros-controls:masterfrom
Conversation
|
Looks good, but if previous |
Good question. The previous |
saikishor
left a comment
There was a problem hiding this comment.
That's weird. How come the tests were passing till now? 🤔
I think the controller must be failing to load (returning nullptr). It's the only way to pass this. That means the there is also a bug. |
|
If the previous I'll verify the actual return value and investigate whether this is due to a configuration/plugin issue or something in the test setup itself, rather than just the assertion. I'll update the PR once I confirm the behavior. |
|
Verified that Reverted the assertion and added an invalid controller test to ensure failure cases are properly covered. |
|
The |
|
okay I'll change that again but what exactly do i follow up, I added additional test function for an invalid controller configuration to explicitly verify failure cases, so both success and failure paths are covered. What do you think of that? |
|
From what I see, we have a bug somewhere. Since Let's see what maintainers has to say :) |
Co-authored-by: Surya! <thedevmystic@gmail.com>
Fixes #1258
Problem
The
test_load_controllertest inadmittance_controllerwas usingASSERT_EQto check againstnullptr, which means the test was asserting that the controller fails to load. Since the controller loads successfully with the params file provided, the test was always passing, even though it was checking the wrong condition.Fix
Changed
ASSERT_EQtoASSERT_NEso the test correctly asserts that the controller loaded successfully (i.e. the result is not nullptr).Note:
range_sensor_broadcasteralready has the correctASSERT_NEin its load test and does not need changes.