提交 21094626 编写于 作者: Z Zhang Liangliang 提交者: Dong Li

fixed brake60_test

上级 ef2cc2b4
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include <bitset>
#include <iostream>
namespace apollo { namespace apollo {
namespace canbus { namespace canbus {
namespace lincoln { namespace lincoln {
...@@ -30,8 +33,26 @@ class Brake60Test : public ::testing::Test { ...@@ -30,8 +33,26 @@ class Brake60Test : public ::testing::Test {
TEST_F(Brake60Test, simple) { TEST_F(Brake60Test, simple) {
Brake60 brake; Brake60 brake;
EXPECT_EQ(brake.GetPeriod(), 20 * 1000); EXPECT_EQ(brake.GetPeriod(), 20 * 1000);
uint8_t data = 0x64; uint8_t data[8] = {0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68};
brake.UpdateData(&data); brake.UpdateData(data);
/* output should be:
00000000
00000000
01100010
01100100
01100101
01100110
01100111
00000000
*/
EXPECT_EQ(data[0], 0b00000000);
EXPECT_EQ(data[1], 0b00000000);
EXPECT_EQ(data[2], 0b01100010);
EXPECT_EQ(data[3], 0b01100100);
EXPECT_EQ(data[4], 0b01100101);
EXPECT_EQ(data[5], 0b01100110);
EXPECT_EQ(data[6], 0b01100111);
EXPECT_EQ(data[7], 0b00000000);
} }
} // namespace lincoln } // namespace lincoln
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册