20 static void setUp(
void) {
26 static void tearDown(
void) {
33 static void test_Init(
void) {
34 TEST_ASSERT_EQUAL_INT(0b00110000, bus->GetPutStack());
35 TEST_ASSERT_EQUAL_INT(0b11111111, bus->GetPutStack());
36 TEST_ASSERT_EQUAL_INT(-1, bus->GetPutStack());
39 static void test_ReadGyroPositiveNumbers(
void) {
40 char indata[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06};
41 bus->SetXYZ(indata, 6);
43 TEST_ASSERT_TRUE(gyro.
ReadGyro(x, y, z));
45 TEST_ASSERT_EQUAL_HEX32(0x0201, x);
46 TEST_ASSERT_EQUAL_HEX32(0x0403, y);
47 TEST_ASSERT_EQUAL_HEX32(0x0605, z);
50 static void test_ReadGyroNegativeNumbers(
void) {
51 char indata[] = {0x01, 0xF2, 0x03, 0xF4, 0x05, 0xF6};
52 bus->SetXYZ(indata, 6);
54 TEST_ASSERT_TRUE(gyro.
ReadGyro(x, y, z));
56 TEST_ASSERT_EQUAL_HEX32(0xFFFFF201, x);
57 TEST_ASSERT_EQUAL_HEX32(0xFFFFF403, y);
58 TEST_ASSERT_EQUAL_HEX32(0xFFFFF605, z);