mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[hal] Ensure HAL status variables are initialized to zero (#3421)
HAL functions don't set the status variable on success, so it's possible to use the status variable in an uninitialized state.
This commit is contained in:
@@ -28,12 +28,11 @@ TEST(SolenoidSimTests, TestPCMInitialization) {
|
||||
false);
|
||||
ASSERT_TRUE(0 != callbackId);
|
||||
|
||||
int32_t status;
|
||||
int32_t status = 0;
|
||||
int32_t module;
|
||||
HAL_CTREPCMHandle pcmHandle;
|
||||
|
||||
// Use out of range index
|
||||
status = 0;
|
||||
module = 8000;
|
||||
gTestSolenoidCallbackName = "Unset";
|
||||
pcmHandle = HAL_InitializeCTREPCM(module, nullptr, &status);
|
||||
|
||||
Reference in New Issue
Block a user