Files
allwpilib/wpilibc/src/test/native/cpp/event/EventLoopTest.cpp

25 lines
584 B
C++
Raw Normal View History

// 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>
2025-11-07 19:56:21 -05:00
#include "wpi/system/Errors.hpp"
#include "wpi/event/EventLoop.hpp"
using namespace frc;
TEST(EventLoopTest, ConcurrentModification) {
EventLoop loop;
loop.Bind([&loop] { ASSERT_THROW(loop.Bind([] {}), frc::RuntimeError); });
loop.Poll();
loop.Clear();
loop.Bind([&loop] { ASSERT_THROW(loop.Clear(), frc::RuntimeError); });
loop.Poll();
}