drivers: fake: now just check for CONFIG_ZTEST
Old ztest API is deprecated, so only check for CONFIG_ZTEST. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
f067bc43c9
commit
85c4703a46
3 changed files with 12 additions and 12 deletions
|
@ -11,9 +11,9 @@
|
|||
#include <zephyr/drivers/rtc.h>
|
||||
#include <zephyr/drivers/rtc/rtc_fake.h>
|
||||
|
||||
#ifdef CONFIG_ZTEST_NEW_API
|
||||
#ifdef CONFIG_ZTEST
|
||||
#include <zephyr/ztest.h>
|
||||
#endif /* CONFIG_ZTEST_NEW_API */
|
||||
#endif /* CONFIG_ZTEST */
|
||||
|
||||
DEFINE_FAKE_VALUE_FUNC(int, rtc_fake_set_time, const struct device *, const struct rtc_time *);
|
||||
DEFINE_FAKE_VALUE_FUNC(int, rtc_fake_get_time, const struct device *, struct rtc_time *);
|
||||
|
@ -40,7 +40,7 @@ DEFINE_FAKE_VALUE_FUNC(int, rtc_fake_set_calibration, const struct device *, int
|
|||
DEFINE_FAKE_VALUE_FUNC(int, rtc_fake_get_calibration, const struct device *, int32_t *);
|
||||
#endif /* CONFIG_RTC_CALIBRATION */
|
||||
|
||||
#ifdef CONFIG_ZTEST_NEW_API
|
||||
#ifdef CONFIG_ZTEST
|
||||
static void fake_rtc_reset_rule_before(const struct ztest_unit_test *test, void *fixture)
|
||||
{
|
||||
ARG_UNUSED(test);
|
||||
|
@ -68,7 +68,7 @@ static void fake_rtc_reset_rule_before(const struct ztest_unit_test *test, void
|
|||
}
|
||||
|
||||
ZTEST_RULE(fake_rtc_reset_rule, fake_rtc_reset_rule_before, NULL);
|
||||
#endif /* CONFIG_ZTEST_NEW_API */
|
||||
#endif /* CONFIG_ZTEST */
|
||||
|
||||
struct rtc_driver_api rtc_fake_driver_api = {
|
||||
.set_time = rtc_fake_set_time,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue