Skip to content

Commit

Permalink
drivertest:fix timer testcase
Browse files Browse the repository at this point in the history
Signed-off-by: yangguangcai <[email protected]>
  • Loading branch information
yangguangcai1 authored and xiaoxiang781216 committed Aug 10, 2023
1 parent 1dc7845 commit 5c6ffe1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions testing/drivertest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ MAINSRC += drivertest_block.c
endif

ifneq ($(CONFIG_RTC),)
ifneq ($(CONFIG_SIG_EVTHREAD),)
MAINSRC += drivertest_rtc.c
PROGNAME += cmocka_driver_rtc
endif
endif

ifneq ($(CONFIG_TIMER),)
MAINSRC += drivertest_timer.c
Expand Down
8 changes: 4 additions & 4 deletions testing/drivertest/drivertest_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
#define TIMER_DEFAULT_DEVPATH "/dev/timer0"
#define TIMER_DEFAULT_INTERVAL 1000000
#define TIMER_DEFAULT_NSAMPLES 20
#define TIMER_DEFAULT_SIGNO 32
#define TIMER_DEFAULT_RANGE 1
#define TIMER_DEFAULT_SIGNO 31
#define TIMER_DEFAULT_RANGE 1000

#define OPTARG_TO_VALUE(value, type, base) \
do \
Expand Down Expand Up @@ -257,9 +257,9 @@ static void test_case_timer(FAR void **state)

ret = ioctl(fd, TCIOC_GETSTATUS, &timer_status);
assert_return_code(ret, OK);
assert_int_equal(timer_state->interval / 1000, timer_status.timeout);
assert_int_equal(timer_state->interval, timer_status.timeout);
assert_in_range(timer_status.timeleft,
0, timer_state->interval / 1000);
0, timer_state->interval);

/* Get max timeout */

Expand Down

0 comments on commit 5c6ffe1

Please sign in to comment.