mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 20:57:47 +00:00
Update the MessageQueue and add unit test for it. (#1089)
This commit makes the following changes: - It adds a unit test for testing different `MessageQueue` operations. - It modifies how the `MessageQueue` determines the lists (the `kListAll` is maintained by the message pool and the `kListInterface` is accessed from the `MessageQueue` associated with the list). - It modifies the underlying list implementation to use a circular doubly linked-list.
This commit is contained in:
committed by
Jonathan Hui
parent
97fbca2063
commit
9d3bd7802b
@@ -65,6 +65,9 @@ namespace Thread
|
||||
// test_message.cpp
|
||||
void TestMessage();
|
||||
|
||||
// test_message_queue.cpp
|
||||
void TestMessageQueue();
|
||||
|
||||
// test_ncp_buffer.cpp
|
||||
namespace Thread
|
||||
{
|
||||
@@ -92,7 +95,7 @@ utAssertTrue s_AssertTrue;
|
||||
utLogMessage s_LogMessage;
|
||||
|
||||
namespace Thread
|
||||
{
|
||||
{
|
||||
TEST_CLASS(UnitTests)
|
||||
{
|
||||
public:
|
||||
@@ -114,7 +117,7 @@ namespace Thread
|
||||
va_start(args, format);
|
||||
vsnprintf(message, sizeof(message), format, args);
|
||||
va_end(args);
|
||||
|
||||
|
||||
Logger::WriteMessage(message);
|
||||
}
|
||||
|
||||
@@ -145,7 +148,10 @@ namespace Thread
|
||||
// test_message.cpp
|
||||
TEST_METHOD(TestMessage) { ::TestMessage(); }
|
||||
|
||||
// test_message.cpp
|
||||
// test_message_queue.cpp
|
||||
TEST_METHOD(TestMessageQueue) { ::TestMessageQueue(); }
|
||||
|
||||
// test_timer.cpp
|
||||
TEST_METHOD(TestOneTimer) { ::TestOneTimer(); }
|
||||
TEST_METHOD(TestTenTimers) { ::TestTenTimers(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user