提交 83513d8a 编写于 作者: L luoqi06 提交者: Qi Luo

Canbus : add test for gem yaw rate

上级 1741209f
......@@ -113,4 +113,16 @@ cc_test(
],
)
cc_test(
name = "yaw_rate_rpt_81_test",
size = "small",
srcs = [
"yaw_rate_rpt_81_test.cc",
],
deps = [
"//modules/canbus/vehicle/gem/protocol:canbus_gem_protocol",
"@gtest//:main",
],
)
cpplint()
/******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "modules/canbus/vehicle/gem/protocol/yaw_rate_rpt_81.h"
#include "gtest/gtest.h"
namespace apollo {
namespace canbus {
namespace gem {
class YawRatePrt81Test : public ::testing::Test {
public:
virtual void SetUp() {}
};
TEST_F(YawRatePrt81Test, reset) {
Yawraterpt81 yaw_rate;
int32_t length = 8;
ChassisDetail chassis_detail;
uint8_t bytes[8] = {0x01, 0x02, 0x03, 0x04, 0x11, 0x12, 0x13, 0x14};
yaw_rate.Parse(bytes, length, &chassis_detail);
EXPECT_DOUBLE_EQ(chassis_detail.gem().yaw_rate_rpt_81().yaw_rate(), 2.58);
}
} // namespace gem
} // namespace canbus
} // namespace apollo
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册