[wpilibc] Add more unit tests (#3494)

This commit is contained in:
PJ Reiniger
2021-08-05 22:04:51 -04:00
committed by GitHub
parent b253246959
commit 94e0db7963
30 changed files with 2588 additions and 89 deletions

View File

@@ -28,8 +28,8 @@ Solenoid::Solenoid(PneumaticsBase* module, int channel)
Solenoid::Solenoid(std::shared_ptr<PneumaticsBase> module, int channel)
: m_module{std::move(module)} {
if (!m_module->CheckSolenoidChannel(m_channel)) {
throw FRC_MakeError(err::ChannelIndexOutOfRange, "Channel {}", m_channel);
if (!m_module->CheckSolenoidChannel(channel)) {
throw FRC_MakeError(err::ChannelIndexOutOfRange, "Channel {}", channel);
}
m_channel = channel;
m_mask = 1 << channel;