mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal, wpilib] Add RobotController.getComments() (#4463)
This commit is contained in:
@@ -224,4 +224,24 @@ TEST(RoboRioSimTest, SetSerialNumber) {
|
||||
EXPECT_EQ(kSerialNumberTruncated, RobotController::GetSerialNumber());
|
||||
}
|
||||
|
||||
TEST(RoboRioSimTest, SetComments) {
|
||||
const std::string kComments =
|
||||
"Hello! These are comments in the roboRIO web interface!";
|
||||
|
||||
RoboRioSim::ResetData();
|
||||
|
||||
RoboRioSim::SetComments(kComments);
|
||||
EXPECT_EQ(kComments, RoboRioSim::GetComments());
|
||||
EXPECT_EQ(kComments, RobotController::GetComments());
|
||||
|
||||
const std::string kCommentsOverflow =
|
||||
"Hello! These are comments in the roboRIO web interface! This comment "
|
||||
"exceeds 64 characters!";
|
||||
const std::string kCommentsTruncated = kCommentsOverflow.substr(0, 64);
|
||||
|
||||
RoboRioSim::SetComments(kCommentsOverflow);
|
||||
EXPECT_EQ(kCommentsTruncated, RoboRioSim::GetComments());
|
||||
EXPECT_EQ(kCommentsTruncated, RobotController::GetComments());
|
||||
}
|
||||
|
||||
} // namespace frc::sim
|
||||
|
||||
Reference in New Issue
Block a user