AP_NavEKF: use NEW_NOTHROW for new(std::nothrow)

This commit is contained in:
Andrew Tridgell 2024-05-27 11:24:13 +10:00
parent 94cbd7cbfb
commit 242a3741e3
1 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ TEST(ekf_imu_buffer, one_element_case)
struct element {
uint8_t value;
};
ekf_imu_buffer *b = new ekf_imu_buffer(sizeof(element));
ekf_imu_buffer *b = NEW_NOTHROW ekf_imu_buffer(sizeof(element));
b->init(1); // 1 element
EXPECT_EQ(b->is_filled(), false);
EXPECT_EQ(b->get_oldest_index(), b->get_youngest_index());
@ -157,7 +157,7 @@ TEST(ekf_imu_buffer, is_filled)
struct element {
uint8_t value;
};
ekf_imu_buffer *b = new ekf_imu_buffer(sizeof(element));
ekf_imu_buffer *b = NEW_NOTHROW ekf_imu_buffer(sizeof(element));
b->init(4); // 4 elements
const element e { 34 };