lockless_queue_test.cc
Go to the documentation of this file.
2 #include "gtest/gtest.h"
3 
4 namespace cartographer {
5 namespace common {
6 namespace {
7 
8 TEST(LocklessQueueTest, PushAndPop) {
9  LocklessQueue<int> queue;
10  queue.Push(common::make_unique<int>(1));
11  queue.Push(common::make_unique<int>(2));
12  EXPECT_EQ(*queue.Pop(), 1);
13  queue.Push(common::make_unique<int>(3));
14  queue.Push(common::make_unique<int>(4));
15  EXPECT_EQ(*queue.Pop(), 2);
16  queue.Push(common::make_unique<int>(5));
17  EXPECT_EQ(*queue.Pop(), 3);
18  EXPECT_EQ(*queue.Pop(), 4);
19  EXPECT_EQ(*queue.Pop(), 5);
20  EXPECT_EQ(queue.Pop(), nullptr);
21 }
22 
23 } // namespace
24 } // namespace common
25 } // namespace cartographer
TEST(TrajectoryConnectivityStateTest, UnknownTrajectory)


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:58