[upstream_utils] Import ConcurrentQueue to wpiutil (#7066)

This commit is contained in:
Ryan Blue
2024-09-11 02:12:22 -04:00
committed by GitHub
parent 21cbb68465
commit 97c6c86f3b
6 changed files with 3815 additions and 1 deletions

View File

@@ -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 <gtest/gtest.h>
#include "wpi/concurrentqueue.h"
TEST(ConcurrentQueueTest, Basic) {
wpi::ConcurrentQueue<int> q;
q.enqueue(25);
int item;
bool found = q.try_dequeue(item);
EXPECT_TRUE(found);
EXPECT_EQ(item, 25);
}