mirror of
https://github.com/mmueller41/mxtasking.git
synced 2026-01-21 12:42:57 +01:00
Initial commit
This commit is contained in:
17
test/mx/util/queue.test.cpp
Normal file
17
test/mx/util/queue.test.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <mx/util/queue.h>
|
||||
#include <mx/util/queue_item.h>
|
||||
|
||||
TEST(MxTasking, Queue)
|
||||
{
|
||||
auto queue = mx::util::Queue<mx::util::QueueItem>{};
|
||||
EXPECT_EQ(queue.empty(), true);
|
||||
|
||||
auto queue_item = mx::util::QueueItem{};
|
||||
queue.push_back(&queue_item);
|
||||
EXPECT_EQ(queue.empty(), false);
|
||||
auto *pulled_item = queue.pop_front();
|
||||
EXPECT_EQ(&queue_item, pulled_item);
|
||||
EXPECT_EQ(queue.empty(), true);
|
||||
EXPECT_EQ(queue.pop_front(), nullptr);
|
||||
}
|
||||
Reference in New Issue
Block a user