Skip to content

Commit

Permalink
drivers: fake: remove special handling for new ztest APIs
Browse files Browse the repository at this point in the history
Old ztest API is deprecated, so no need for the conditional code here.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information
nashif committed Oct 16, 2023
1 parent 9b8f519 commit 3d02e3f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
5 changes: 0 additions & 5 deletions drivers/can/can_fake.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
#include <zephyr/drivers/can.h>
#include <zephyr/drivers/can/can_fake.h>
#include <zephyr/fff.h>

#ifdef CONFIG_ZTEST_NEW_API
#include <zephyr/ztest.h>
#endif /* CONFIG_ZTEST_NEW_API */

#define DT_DRV_COMPAT zephyr_fake_can

Expand Down Expand Up @@ -46,7 +43,6 @@ DEFINE_FAKE_VOID_FUNC(fake_can_set_state_change_callback, const struct device *,

DEFINE_FAKE_VALUE_FUNC(int, fake_can_get_max_filters, const struct device *, bool);

#ifdef CONFIG_ZTEST_NEW_API
static void fake_can_reset_rule_before(const struct ztest_unit_test *test, void *fixture)
{
ARG_UNUSED(test);
Expand All @@ -68,7 +64,6 @@ static void fake_can_reset_rule_before(const struct ztest_unit_test *test, void
}

ZTEST_RULE(fake_can_reset_rule, fake_can_reset_rule_before, NULL);
#endif /* CONFIG_ZTEST_NEW_API */

static int fake_can_get_core_clock(const struct device *dev, uint32_t *rate)
{
Expand Down
5 changes: 0 additions & 5 deletions drivers/eeprom/eeprom_fake.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
#include <zephyr/drivers/eeprom.h>
#include <zephyr/drivers/eeprom/eeprom_fake.h>
#include <zephyr/fff.h>

#ifdef CONFIG_ZTEST_NEW_API
#include <zephyr/ztest.h>
#endif /* CONFIG_ZTEST_NEW_API */

#define DT_DRV_COMPAT zephyr_fake_eeprom

Expand All @@ -32,7 +29,6 @@ size_t fake_eeprom_size_delegate(const struct device *dev)
return config->size;
}

#ifdef CONFIG_ZTEST_NEW_API
static void fake_eeprom_reset_rule_before(const struct ztest_unit_test *test, void *fixture)
{
ARG_UNUSED(test);
Expand All @@ -47,7 +43,6 @@ static void fake_eeprom_reset_rule_before(const struct ztest_unit_test *test, vo
}

ZTEST_RULE(fake_eeprom_reset_rule, fake_eeprom_reset_rule_before, NULL);
#endif /* CONFIG_ZTEST_NEW_API */

static const struct eeprom_driver_api fake_eeprom_driver_api = {
.read = fake_eeprom_read,
Expand Down
5 changes: 0 additions & 5 deletions drivers/rtc/rtc_fake.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
#include <zephyr/device.h>
#include <zephyr/drivers/rtc.h>
#include <zephyr/drivers/rtc/rtc_fake.h>

#ifdef CONFIG_ZTEST_NEW_API
#include <zephyr/ztest.h>
#endif /* CONFIG_ZTEST_NEW_API */

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 *);
Expand All @@ -40,7 +37,6 @@ 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
static void fake_rtc_reset_rule_before(const struct ztest_unit_test *test, void *fixture)
{
ARG_UNUSED(test);
Expand Down Expand Up @@ -68,7 +64,6 @@ 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 */

struct rtc_driver_api rtc_fake_driver_api = {
.set_time = rtc_fake_set_time,
Expand Down

0 comments on commit 3d02e3f

Please sign in to comment.