34 #include <gtest/gtest.h> 74 ASSERT_EQ(
true, _buffer->allocate(3));
90 ASSERT_EQ(
true, _buffer->allocate(3));
96 EXPECT_EQ(_x.time_us, _buffer->get_newest().time_us);
97 EXPECT_EQ(_x.time_us, _buffer->get_oldest().time_us);
102 EXPECT_EQ(_x.time_us, _buffer->get_oldest().time_us);
103 EXPECT_EQ(_y.time_us, _buffer->get_newest().time_us);
108 ASSERT_EQ(
true, _buffer->allocate(3));
118 EXPECT_EQ(
false, _buffer->pop_first_older_than(0, &pop));
122 EXPECT_EQ(
true, _buffer->pop_first_older_than(_x.time_us+1, &pop));
123 EXPECT_EQ(_x.time_us, pop.
time_us);
124 EXPECT_EQ(
true, _buffer->pop_first_older_than(_y.time_us+10, &pop));
125 EXPECT_EQ(_y.time_us, pop.
time_us);
126 EXPECT_EQ(
true, _buffer->pop_first_older_than(_z.time_us+100, &pop));
127 EXPECT_EQ(_z.time_us, pop.
time_us);
133 ASSERT_EQ(
true, _buffer->allocate(3));
141 EXPECT_EQ(
true, _buffer->pop_first_older_than(_z.time_us+99000, &pop));
142 EXPECT_EQ(
false, _buffer->pop_first_older_than(_y.time_us+100000, &pop));
147 ASSERT_EQ(
true, _buffer->allocate(5));
156 _buffer->allocate(3);
158 EXPECT_EQ(3,_buffer->get_length());
RingBuffer< sample > * _buffer
TEST_F(EkfRingBufferTest, goodInitialisation)
Class for core functions for ekf attitude and position estimator.