Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing/drivertest: add watch dog irq test #1919

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions testing/drivertest/drivertest_watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,19 @@ static uint32_t get_time_elaps(uint32_t prev_tick)
static void wdg_write_reset_cause(FAR struct wdg_state_s *state)
{
int fd;
int ret;
ssize_t size;

fd = open(state->infopath, O_WRONLY | O_CREAT);
fd = open(state->infopath, O_WRONLY | O_CREAT, 0666);
assert_true(fd > 0);

size = write(fd, &state->reset_cause, sizeof(state->reset_cause));
assert_int_equal(size, sizeof(state->reset_cause));

close(fd);
ret = fsync(fd);
assert_return_code(ret, OK);
ret = close(fd);
assert_return_code(ret, OK);
}

/****************************************************************************
Expand All @@ -160,6 +164,7 @@ static void wdg_write_reset_cause(FAR struct wdg_state_s *state)
static void wdg_read_reset_cause(FAR struct wdg_state_s *state)
{
int fd;
int ret;
ssize_t size;

fd = open(state->infopath, O_RDONLY);
Expand All @@ -172,7 +177,8 @@ static void wdg_read_reset_cause(FAR struct wdg_state_s *state)
size = read(fd, &state->reset_cause, sizeof(state->reset_cause));
assert_int_equal(size, sizeof(state->reset_cause));

close(fd);
ret = close(fd);
assert_return_code(ret, OK);
}

/****************************************************************************
Expand Down Expand Up @@ -457,7 +463,8 @@ static void test_case_wdog_04(FAR void **state)
wdg_read_reset_cause(wdg_state);
assert_int_equal(wdg_state->reset_cause, WDG_RESET_CAUSE_IRQ_BUSY_LOOP);

remove(wdg_state->infopath);
ret = remove(wdg_state->infopath);
assert_return_code(ret, OK);

dev_fd = wdg_init(wdg_state);

Expand All @@ -484,7 +491,8 @@ static void test_case_wdog_04(FAR void **state)
ret = ioctl(dev_fd, WDIOC_STOP, 0);
assert_return_code(ret, OK);

close(dev_fd);
ret = close(dev_fd);
assert_return_code(ret, OK);
}

/****************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion tools/mkkconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fi

echo mkkconfig in $PWD

KCONFIG_LIST=`ls -1 $PWD/*/Kconfig`
KCONFIG_LIST=`ls -1 $PWD/*/Kconfig 2>/dev/null`

echo "#" > ${KCONFIG}
echo "# For a description of the syntax of this configuration file," >> ${KCONFIG}
Expand Down
Loading