mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpilibj] Add unit tests (#3501)
This commit is contained in:
@@ -70,10 +70,6 @@ public class DoubleSolenoid implements Sendable, AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
if (module.checkAndReserveSolenoids(m_mask) != 0) {
|
||||
throw new AllocationException("Solenoid(s) already allocated");
|
||||
}
|
||||
|
||||
HAL.report(
|
||||
tResourceType.kResourceType_Solenoid, forwardChannel + 1, module.getModuleNumber() + 1);
|
||||
HAL.report(
|
||||
|
||||
@@ -32,7 +32,7 @@ public class PneumaticsControlModule implements PneumaticsBase, Sendable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {
|
||||
public void close() {
|
||||
CTREPCMJNI.free(m_handle);
|
||||
SendableRegistry.remove(this);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
|
||||
import edu.wpi.first.hal.FRCNetComm.tResourceType;
|
||||
import edu.wpi.first.hal.HAL;
|
||||
import edu.wpi.first.hal.RelayJNI;
|
||||
import edu.wpi.first.hal.util.HalHandleException;
|
||||
import edu.wpi.first.hal.util.UncleanStatusException;
|
||||
import edu.wpi.first.util.sendable.Sendable;
|
||||
import edu.wpi.first.util.sendable.SendableBuilder;
|
||||
@@ -135,12 +136,12 @@ public class Relay extends MotorSafety implements Sendable, AutoCloseable {
|
||||
private void freeRelay() {
|
||||
try {
|
||||
RelayJNI.setRelay(m_forwardHandle, false);
|
||||
} catch (UncleanStatusException ignored) {
|
||||
} catch (UncleanStatusException | HalHandleException ignored) {
|
||||
// do nothing. Ignore
|
||||
}
|
||||
try {
|
||||
RelayJNI.setRelay(m_reverseHandle, false);
|
||||
} catch (UncleanStatusException ignored) {
|
||||
} catch (UncleanStatusException | HalHandleException ignored) {
|
||||
// do nothing. Ignore
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user