mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-05 17:08:52 +08:00
Style fix: LinkedListRoot<>::length() --> getLength()
This commit is contained in:
@@ -48,7 +48,7 @@ public:
|
||||
T* get() const { return root_; }
|
||||
bool isEmpty() const { return get() == NULL; }
|
||||
|
||||
unsigned int length() const
|
||||
unsigned int getLength() const
|
||||
{
|
||||
T* node = root_;
|
||||
unsigned int cnt = 0;
|
||||
|
||||
@@ -44,7 +44,7 @@ class Dispatcher : Noncopyable
|
||||
void cleanup(uint64_t ts_monotonic);
|
||||
void handleFrame(const RxFrame& frame);
|
||||
|
||||
int getNumEntries() const { return list_.length(); }
|
||||
int getNumEntries() const { return list_.getLength(); }
|
||||
};
|
||||
|
||||
ListenerRegister lmsg_;
|
||||
|
||||
@@ -422,7 +422,7 @@ public:
|
||||
|
||||
bool isEmpty() const { return (getNumStaticBuffers() == 0) && (getNumDynamicBuffers() == 0); }
|
||||
|
||||
unsigned int getNumDynamicBuffers() const { return dynamic_buffers_.length(); }
|
||||
unsigned int getNumDynamicBuffers() const { return dynamic_buffers_.getLength(); }
|
||||
|
||||
unsigned int getNumStaticBuffers() const
|
||||
{
|
||||
|
||||
@@ -40,23 +40,23 @@ TEST(LinkedList, Basic)
|
||||
/*
|
||||
* Insert/remove
|
||||
*/
|
||||
EXPECT_EQ(0, root.length());
|
||||
EXPECT_EQ(0, root.getLength());
|
||||
|
||||
ListItem item1;
|
||||
root.insert(&item1);
|
||||
root.insert(&item1); // Insert twice - second will be ignored
|
||||
EXPECT_EQ(1, root.length());
|
||||
EXPECT_EQ(1, root.getLength());
|
||||
|
||||
EXPECT_TRUE(root.remove(&item1));
|
||||
EXPECT_FALSE(root.remove(&item1));
|
||||
EXPECT_EQ(0, root.length());
|
||||
EXPECT_EQ(0, root.getLength());
|
||||
|
||||
ListItem items[3];
|
||||
root.insert(&item1);
|
||||
root.insert(items + 0);
|
||||
root.insert(items + 1);
|
||||
root.insert(items + 2);
|
||||
EXPECT_EQ(4, root.length());
|
||||
EXPECT_EQ(4, root.getLength());
|
||||
|
||||
/*
|
||||
* Order persistence
|
||||
@@ -75,7 +75,7 @@ TEST(LinkedList, Basic)
|
||||
EXPECT_TRUE(root.remove(items + 0));
|
||||
EXPECT_TRUE(root.remove(items + 2));
|
||||
EXPECT_FALSE(root.remove(items + 2));
|
||||
EXPECT_EQ(2, root.length());
|
||||
EXPECT_EQ(2, root.getLength());
|
||||
|
||||
const int expected_values2[] = {11, 0};
|
||||
node = root.get();
|
||||
@@ -86,7 +86,7 @@ TEST(LinkedList, Basic)
|
||||
}
|
||||
|
||||
root.insert(items + 2);
|
||||
EXPECT_EQ(3, root.length());
|
||||
EXPECT_EQ(3, root.getLength());
|
||||
EXPECT_EQ(12, root.get()->value);
|
||||
|
||||
/*
|
||||
@@ -96,7 +96,7 @@ TEST(LinkedList, Basic)
|
||||
EXPECT_FALSE(root.remove(items + 0));
|
||||
EXPECT_TRUE(root.remove(items + 1));
|
||||
EXPECT_TRUE(root.remove(items + 2));
|
||||
EXPECT_EQ(0, root.length());
|
||||
EXPECT_EQ(0, root.getLength());
|
||||
}
|
||||
|
||||
TEST(LinkedList, Sorting)
|
||||
@@ -111,7 +111,7 @@ TEST(LinkedList, Sorting)
|
||||
items[1].insort(root);
|
||||
items[5].insort(root);
|
||||
|
||||
EXPECT_EQ(6, root.length());
|
||||
EXPECT_EQ(6, root.getLength());
|
||||
|
||||
int prev_val = -100500;
|
||||
const ListItem* item = root.get();
|
||||
|
||||
Reference in New Issue
Block a user