add cpp benchmark

This commit is contained in:
cyy_mac
2026-07-30 17:25:39 +08:00
parent 3008203f82
commit bd07331734
7 changed files with 226 additions and 24 deletions

View File

@@ -101,6 +101,17 @@ int main() {
CHECK(std::isfinite(state.motorState[FR_1].q));
CHECK(state.wirelessRemote[0] == 0x55 && state.wirelessRemote[1] == 0x51);
LowState truncated_state{};
CHECK(!codec.DecodeLowState(state_packet.data(),
go1_pro_internal::kLowStateParsedSize,
truncated_state));
CHECK(codec.DecodeLowState(state_packet.data(),
go1_pro_internal::kLowStateParsedSize + 1,
truncated_state));
CHECK(truncated_state.motorState[FR_1].temperature ==
state.motorState[FR_1].temperature);
CHECK(truncated_state.crc == state.crc);
const auto old_state_packet = ReadFile(GO1_PRO_TEST_CAPTURE_OLD);
CHECK(old_state_packet.size() == go1_pro_internal::kLowStateDatagramSize);
LowState old_state{};