diff --git a/libuavcan/test/node/test_node.hpp b/libuavcan/test/node/test_node.hpp index bd71b89ee3..8032d06419 100644 --- a/libuavcan/test/node/test_node.hpp +++ b/libuavcan/test/node/test_node.hpp @@ -10,6 +10,7 @@ #endif #include +#include #include #include #include @@ -19,13 +20,20 @@ struct TestNode : public uavcan::INode { - uavcan::PoolAllocator pool; + /* + * This class used to use the simple pool allocator instead: + * uavcan::PoolAllocator pool; + * It has been replaced because unlike the simple allocator, heap-based one is not tested as extensively. + * Moreover, heap based allocator prints and error message upon destruction if some memory has not been freed. + */ + uavcan::HeapBasedPoolAllocator pool; uavcan::Scheduler scheduler; uint64_t internal_failure_count; - TestNode(uavcan::ICanDriver& can_driver, uavcan::ISystemClock& clock_driver, uavcan::NodeID self_node_id) - : scheduler(can_driver, pool, clock_driver) - , internal_failure_count(0) + TestNode(uavcan::ICanDriver& can_driver, uavcan::ISystemClock& clock_driver, uavcan::NodeID self_node_id) : + pool(1024), + scheduler(can_driver, pool, clock_driver), + internal_failure_count(0) { setNodeID(self_node_id); }