2020-12-26 14:12:05 -08:00
|
|
|
// 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.
|
2018-05-16 19:45:46 -07:00
|
|
|
|
2020-07-04 10:10:43 -07:00
|
|
|
#include <exception>
|
|
|
|
|
|
2020-06-27 22:11:24 -07:00
|
|
|
#include <hal/HAL.h>
|
|
|
|
|
|
2020-07-04 10:10:43 -07:00
|
|
|
#include "frc/simulation/AddressableLEDSim.h"
|
2020-06-27 22:11:24 -07:00
|
|
|
#include "frc/simulation/AnalogGyroSim.h"
|
2020-07-04 10:10:43 -07:00
|
|
|
#include "frc/simulation/AnalogInputSim.h"
|
|
|
|
|
#include "frc/simulation/AnalogOutputSim.h"
|
2020-06-27 22:11:24 -07:00
|
|
|
#include "frc/simulation/AnalogTriggerSim.h"
|
2020-07-04 10:10:43 -07:00
|
|
|
#include "frc/simulation/BuiltInAccelerometerSim.h"
|
2020-06-27 22:11:24 -07:00
|
|
|
#include "frc/simulation/DIOSim.h"
|
|
|
|
|
#include "frc/simulation/DigitalPWMSim.h"
|
|
|
|
|
#include "frc/simulation/DriverStationSim.h"
|
2020-07-04 10:10:43 -07:00
|
|
|
#include "frc/simulation/DutyCycleSim.h"
|
2020-06-27 22:11:24 -07:00
|
|
|
#include "frc/simulation/EncoderSim.h"
|
|
|
|
|
#include "frc/simulation/PCMSim.h"
|
|
|
|
|
#include "frc/simulation/PDPSim.h"
|
|
|
|
|
#include "frc/simulation/PWMSim.h"
|
|
|
|
|
#include "frc/simulation/RelaySim.h"
|
|
|
|
|
#include "frc/simulation/RoboRioSim.h"
|
|
|
|
|
#include "frc/simulation/SPIAccelerometerSim.h"
|
2018-05-16 19:45:46 -07:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
|
|
using namespace frc::sim;
|
|
|
|
|
|
|
|
|
|
TEST(SimInitializationTests, TestAllInitialize) {
|
|
|
|
|
HAL_Initialize(500, 0);
|
2020-07-04 10:10:43 -07:00
|
|
|
BuiltInAccelerometerSim biacsim;
|
2018-05-16 19:45:46 -07:00
|
|
|
AnalogGyroSim agsim{0};
|
2020-07-04 10:10:43 -07:00
|
|
|
AnalogInputSim aisim{0};
|
|
|
|
|
AnalogOutputSim aosim{0};
|
|
|
|
|
EXPECT_THROW(AnalogTriggerSim::CreateForChannel(0), std::out_of_range);
|
|
|
|
|
EXPECT_THROW(DigitalPWMSim::CreateForChannel(0), std::out_of_range);
|
2018-05-16 19:45:46 -07:00
|
|
|
DIOSim diosim{0};
|
|
|
|
|
DriverStationSim dssim;
|
|
|
|
|
(void)dssim;
|
2020-07-04 10:10:43 -07:00
|
|
|
EncoderSim esim = EncoderSim::CreateForIndex(0);
|
|
|
|
|
(void)esim;
|
2018-05-16 19:45:46 -07:00
|
|
|
PCMSim pcmsim{0};
|
|
|
|
|
PDPSim pdpsim{0};
|
|
|
|
|
PWMSim pwmsim{0};
|
|
|
|
|
RelaySim rsim{0};
|
2020-07-04 00:44:56 -07:00
|
|
|
RoboRioSim rrsim;
|
|
|
|
|
(void)rrsim;
|
2018-05-16 19:45:46 -07:00
|
|
|
SPIAccelerometerSim sasim{0};
|
2020-07-04 10:10:43 -07:00
|
|
|
DutyCycleSim dcsim = DutyCycleSim::CreateForIndex(0);
|
|
|
|
|
(void)dcsim;
|
|
|
|
|
AddressableLEDSim adLED;
|
2018-05-16 19:45:46 -07:00
|
|
|
}
|