tests: drivers: gnss: add test for get_fix_rate()
Add a test for this previously untested function Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
parent
64446d2f67
commit
2dd0b4fee0
@ -64,6 +64,21 @@ static bool test_set_fix_rate(const struct test_config *config)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_get_fix_rate(const struct test_config *config)
|
||||
{
|
||||
int ret;
|
||||
uint32_t fix_interval;
|
||||
|
||||
ret = gnss_get_fix_rate(dev, &fix_interval);
|
||||
|
||||
if (ret == -ENOSYS) {
|
||||
ztest_test_skip();
|
||||
}
|
||||
zassert_ok(ret, "failed to get fix rate");
|
||||
zassert_equal(fix_interval, config->fix_interval, "fix_rate mismatch");
|
||||
return true;
|
||||
}
|
||||
|
||||
static void test_validate_fix_rate(const struct test_config *config)
|
||||
{
|
||||
bool valid;
|
||||
@ -83,6 +98,9 @@ ZTEST(gnss_api, test_fix_rate)
|
||||
if (!test_set_fix_rate(&configs[i])) {
|
||||
continue;
|
||||
}
|
||||
if (!test_get_fix_rate(&configs[i])) {
|
||||
continue;
|
||||
}
|
||||
test_validate_fix_rate(&configs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user