Many modules' utests currently don't support enabling all
tests at once. Furthermore, some modules' tests are complex,
for example due to their numerous dependencies on other
modules. This makes it nearly impossible to enable all
tests with a single global switch. Consequently, the
previously defined `RT_UTEST_USING_ALL_CASES` has lost
its original meaning.
We recommend deprecating this configuration switch. If a
module needs to enable a group of functional tests through
its own configuration, this local enable all switch should
be implemented by the module itself, and a global RTT enable
switch will no longer be provided.
If such a requirement arises in the future, we recommend
careful design, especially considering how to ensure that
turning on a single switch enables all dependencies for
all involved modules for ease of use.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
The names of the utest cases defined in their respective
modules have been updated.
Some utest case names are not yet in their respective modules
because their paths need to be finalized before their unique
names can be determined. Currently, these names do not
appear to conflict with the unified names. These include:
- utest cases still in examples
- bsp/qemu-virt64-riscv/applications/test/test_vector/test_vector.c.
The entire test case should probably be placed in libcpu/risc-v
rather than bsp.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
* utest: move testcases of Utest from example to Utest folder
Create unit-test-cases for the Utest framework subsystem
according to "How to add utest cases into RT-Thread for your module." [1]
Link:
https://rt-thread.github.io/rt-thread/page_component_utest.html#autotoc_md804
[1]
The original `components/utilities/utest` directory already has unit
testcases, which are more comprehensive than the testcases in
`examples/utest/testcases/utest/`. Therefore, simply deleted
the test cases in `examples` and used the existing testcases
in the utest framework.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
* utest/utest: rename name and add license text
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
---------
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Append a null statement for "Any statement may be preceded by a prefix that declares an identifier as a label name."
Signed-off-by: GuEe-GUI <2991707448@qq.com>
In the serial ISR (`rt_hw_serial_isr`), the previous logic for handling a full RX FIFO was flawed. When the buffer was filled, it would increment `get_index` (`get_index += 1`).
This had two negative consequences:
1. It effectively discarded the oldest byte of data prematurely.
2. It reduced the usable capacity of a buffer of size N to N-1. For example, a 64-byte buffer could only ever hold 63 readable bytes after becoming full.
This patch corrects the behavior by implementing a standard overwriting ring buffer strategy. When the buffer is full, the logic is changed to `get_index = put_index`.
This ensures that:
- When new data arrives, it correctly overwrites the oldest data.
- The `get_index` is advanced along with the `put_index`, correctly marking the new start of the buffer.
- The full N-byte capacity of the buffer is utilized, always storing the N most recent bytes.
This change resolves the unexpected data loss and makes the buffer behavior correct and predictable.
* [bugfix][component/dfs]1.Skip the trailing slash character failed. 2. Scenario that parent path is root is not considered.
* replace strdup() by rt_strdup().
* free memory after strdup().
* fix issue of not appending '\0' at end when parent path is root.