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

add additional tests for file stream and Unix sockets functionality #369

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ziemleszcz
Copy link
Contributor

@ziemleszcz ziemleszcz commented Aug 22, 2024

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

phoenix-rtos/phoenix-rtos-kernel#579
phoenix-rtos/libphoenix#376

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

Copy link

github-actions bot commented Aug 22, 2024

Unit Test Results

7 919 tests  +132   7 073 ✅ +  4   41m 7s ⏱️ - 1m 40s
  461 suites ±  0     717 💤  -   1 
    1 files   ±  0     129 ❌ +129 

For more details on these failures, see this check.

Results for commit 9de5d91. ± Comparison against base commit 7e3f9f2.

This pull request removes 15 and adds 147 tests. Note that renamed tests count towards both.
phoenix-rtos-tests/libc/stdio ‑ host-generic-pc:phoenix-rtos-tests/libc/stdio.stdio_bufs.setbuf_basic
phoenix-rtos-tests/libc/stdio ‑ host-generic-pc:phoenix-rtos-tests/libc/stdio.stdio_bufs.setbuf_null
phoenix-rtos-tests/libc/stdio ‑ host-generic-pc:phoenix-rtos-tests/libc/stdio.stdio_bufs.setvbuf_fullbuffer
phoenix-rtos-tests/libc/stdio ‑ host-generic-pc:phoenix-rtos-tests/libc/stdio.stdio_bufs.setvbuf_fullbuffer_overflow
phoenix-rtos-tests/libc/stdio ‑ host-generic-pc:phoenix-rtos-tests/libc/stdio.stdio_bufs.setvbuf_linebuffer
phoenix-rtos-tests/libc/stdio ‑ host-generic-pc:phoenix-rtos-tests/libc/stdio.stdio_bufs.setvbuf_nobuffer
phoenix-rtos-tests/libc/stdio ‑ host-generic-pc:phoenix-rtos-tests/libc/stdio.stdio_fileop.fileop_clearerr
phoenix-rtos-tests/libc/stdio ‑ host-generic-pc:phoenix-rtos-tests/libc/stdio.stdio_fileop.fileop_feof
phoenix-rtos-tests/libc/stdio ‑ host-generic-pc:phoenix-rtos-tests/libc/stdio.stdio_fileop.fileop_ferror
phoenix-rtos-tests/libc/stdio ‑ host-generic-pc:phoenix-rtos-tests/libc/stdio.stdio_fileop.fileop_fileno
…
phoenix-rtos-tests/libc/stdio ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/stdio.stdio_fflush.stdio_fflush_eagain
phoenix-rtos-tests/libc/stdio ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/stdio.stdio_fflush.stdio_fflush_socket
phoenix-rtos-tests/libc/stdio ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/stdio.stdio_fileseek.seek_fseek_feof
phoenix-rtos-tests/libc/stdio ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/stdio.stdio_fileseek.seek_fseek_ferror
phoenix-rtos-tests/libc/stdio ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/stdio.stdio_fileseek.seek_ftell_feof
phoenix-rtos-tests/libc/stdio ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/stdio.stdio_fileseek.seek_ftell_read_buffer
phoenix-rtos-tests/libc/stdio ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/stdio.stdio_fileseek.seek_ftell_write_buffer
phoenix-rtos-tests/libc/stdio ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/stdio.stdio_fread.stdio_fread_buffered_eagain
phoenix-rtos-tests/libc/stdio ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/stdio.stdio_fread.stdio_fread_buffered_eof
phoenix-rtos-tests/libc/stdio ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/libc/stdio.stdio_fread.stdio_fread_buffered_error
…

♻️ This comment has been updated with latest results.

@ziemleszcz ziemleszcz force-pushed the ziemleszcz/RTOS-892 branch 2 times, most recently from 1469559 to 270a415 Compare October 14, 2024 15:20
Copy link
Member

@Darchiv Darchiv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments.

Please tick appropriate ticks and use a meaningful name for the PR.

TEST_ASSERT_EQUAL_INT(strlen(teststr), fread(buf, 1, sizeof(buf), filep));
TEST_ASSERT_EQUAL_INT(1, feof(filep));
TEST_ASSERT_EQUAL_INT(-1, fseek(filep, SEEK_CUR, 10));
TEST_ASSERT_EQUAL_INT(1, feof(filep));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also check if F_ERROR is set after fseek() fails with a read or write error? (In this test case or another.)

TEST_ASSERT_EQUAL_INT(0, err);

errno = 0;
n = fread(buf, 1, 3, filep);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also test fread() with size == 0 or count == 0?

TEST_ASSERT_EQUAL_INT(0, err);

errno = 0;
n = fwrite("1234567", 1, 7, filep[1]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also test fwrite() with size == 0 or count == 0?

errno = 0;
err = fflush(filep[1]);
TEST_ASSERT_EQUAL_INT(-1, err);
TEST_ASSERT_EQUAL_INT(EAGAIN, errno);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also check F_ERROR after fflush() fails?

@ziemleszcz ziemleszcz changed the title Ziemleszcz/rtos 892 add additional tests for file stream and Unix sockets functionality Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants