added another test

This commit is contained in:
Jake Goodwin 2023-09-11 22:44:01 -07:00
parent 6477248e3b
commit 59086bd28b
1 changed files with 10 additions and 0 deletions

View File

@ -351,6 +351,15 @@ static void test_gyro_update(void **state)
assert_true(1); assert_true(1);
} }
static void test_enable_self_test_gyro(void **state)
{
//expect_value(func, param, val);
/*The read register function should be called with */
expect_value(read_register, reg, 27);
enable_self_test_gyro(*state);
}
int main(void) int main(void)
{ {
@ -360,6 +369,7 @@ int main(void)
const struct CMUnitTest twi_group[] = { const struct CMUnitTest twi_group[] = {
cmocka_unit_test_setup_teardown(test_gy521_testing, setup_gy521_instance, teardown_gy521_instance), cmocka_unit_test_setup_teardown(test_gy521_testing, setup_gy521_instance, teardown_gy521_instance),
cmocka_unit_test_setup_teardown(test_gyro_update, setup_gy521_instance, teardown_gy521_instance), cmocka_unit_test_setup_teardown(test_gyro_update, setup_gy521_instance, teardown_gy521_instance),
cmocka_unit_test_setup_teardown(test_enable_self_test_gyro, setup_gy521_instance, teardown_gy521_instance),
}; };
const struct CMUnitTest tests[] = { const struct CMUnitTest tests[] = {
cmocka_unit_test(test_gy521_init), cmocka_unit_test(test_gy521_init),