mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 15:00:34 +08:00
GTest functional tests that include parameters and uORB messaging (#12521)
* Add kdevelop to gitignore * Add test stubs * Rename px4_add_gtest to px4_add_unit_gtest * Add infrastructure to run functional tests * Add example tests with parameters and uorb messages * Fix memory issues in destructors in uORB manager and CDev * Add a more real-world test of the collision prevention
This commit is contained in:
@@ -102,10 +102,10 @@ uORB::DeviceMaster::advertise(const struct orb_metadata *meta, int *instance, in
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* construct the new node */
|
||||
/* construct the new node, passing the ownership of path to it */
|
||||
uORB::DeviceNode *node = new uORB::DeviceNode(meta, group_tries, devpath, priority);
|
||||
|
||||
/* if we didn't get a device, that's bad */
|
||||
/* if we didn't get a device, that's bad, free the path too */
|
||||
if (node == nullptr) {
|
||||
free((void *)devpath);
|
||||
return -ENOMEM;
|
||||
@@ -133,9 +133,6 @@ uORB::DeviceMaster::advertise(const struct orb_metadata *meta, int *instance, in
|
||||
}
|
||||
}
|
||||
|
||||
/* also discard the name now */
|
||||
free((void *)devpath);
|
||||
|
||||
} else {
|
||||
// add to the node map;.
|
||||
_node_list.add(node);
|
||||
|
||||
Reference in New Issue
Block a user