mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 10:50:35 +08:00
CI: enable clang-tidy bugprone-assignment-in-if-condition (#26580)
* docs: auto-sync metadata [skip ci] Co-Authored-By: PX4 BuildBot <bot@px4.io> CI: enable clang-tidy bugprone-assignment-in-if-condition Signed-off-by: kuralme <kuralme@protonmail.com> initialize and immediate assignments made one line Signed-off-by: kuralme <kuralme@protonmail.com> * two more initialization fix Signed-off-by: kuralme <kuralme@protonmail.com> --------- Signed-off-by: kuralme <kuralme@protonmail.com> Co-authored-by: PX4BuildBot <bot@px4.io>
This commit is contained in:
@@ -941,10 +941,10 @@ int uORBTest::UnitTest::pub_test_queue_entry(int argc, char *argv[])
|
||||
int uORBTest::UnitTest::pub_test_queue_main()
|
||||
{
|
||||
orb_test_medium_s t{};
|
||||
orb_advert_t ptopic{nullptr};
|
||||
orb_advert_t ptopic = orb_advertise(ORB_ID(orb_test_medium_queue_poll), &t);
|
||||
const int queue_size = orb_get_queue_size(ORB_ID(orb_test_medium_queue_poll));
|
||||
|
||||
if ((ptopic = orb_advertise(ORB_ID(orb_test_medium_queue_poll), &t)) == nullptr) {
|
||||
if (ptopic == nullptr) {
|
||||
_thread_should_exit = true;
|
||||
return test_fail("advertise failed: %d", errno);
|
||||
}
|
||||
@@ -981,9 +981,9 @@ int uORBTest::UnitTest::test_queue_poll_notify()
|
||||
test_note("Testing orb queuing (poll & notify)");
|
||||
|
||||
orb_test_medium_s t{};
|
||||
int sfd = -1;
|
||||
int sfd = orb_subscribe(ORB_ID(orb_test_medium_queue_poll));
|
||||
|
||||
if ((sfd = orb_subscribe(ORB_ID(orb_test_medium_queue_poll))) < 0) {
|
||||
if (sfd < 0) {
|
||||
return test_fail("subscribe failed: %d", errno);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user