From 05e09e92e69309811498bce1142f5a95b4288ca5 Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Wed, 11 Sep 2024 00:02:29 -0400 Subject: [PATCH] add basic test --- .../cpp/concurrentqueue/ConcurrentQueueTest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 wpiutil/src/test/native/cpp/concurrentqueue/ConcurrentQueueTest.cpp diff --git a/wpiutil/src/test/native/cpp/concurrentqueue/ConcurrentQueueTest.cpp b/wpiutil/src/test/native/cpp/concurrentqueue/ConcurrentQueueTest.cpp new file mode 100644 index 00000000000..97caccfe73f --- /dev/null +++ b/wpiutil/src/test/native/cpp/concurrentqueue/ConcurrentQueueTest.cpp @@ -0,0 +1,17 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include "wpi/concurrentqueue.h" + +#include + +TEST(ConcurrentQueueTest, Basic) { + wpi::ConcurrentQueue q; + q.enqueue(25); + + int item; + bool found = q.try_dequeue(item); + EXPECT_TRUE(found); + EXPECT_EQ(item, 25); +}