Files
allwpilib/hal/src/test/native/cpp/mockdata/SimDeviceDataTest.cpp

24 lines
709 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/hal/SimDevice.h"
#include "wpi/hal/simulation/SimDeviceData.h"
namespace hal {
TEST(SimDeviceSimTest, Enabled) {
ASSERT_TRUE(HALSIM_IsSimDeviceEnabled("foo"));
HALSIM_SetSimDeviceEnabled("f", false);
HALSIM_SetSimDeviceEnabled("foob", true);
ASSERT_FALSE(HALSIM_IsSimDeviceEnabled("foo"));
ASSERT_TRUE(HALSIM_IsSimDeviceEnabled("foobar"));
ASSERT_TRUE(HALSIM_IsSimDeviceEnabled("bar"));
ASSERT_EQ(HAL_CreateSimDevice("foo"), 0);
}
} // namespace hal