Commit Graph

864 Commits

Author SHA1 Message Date
Matt Joyce
4152157e10 Newlib01: Add tests for rand() and lrand48()
Check that the state of rand() and lrand48() is thread-specific,
that they are properly initialized, and return the expected
sequence of pseudo-random numbers for default seed values.
2022-06-09 08:10:19 +02:00
Chris Johns
80aea6aee1 testsuite/libtests: Add exit03 to test exit() with C++
Updates #4661
2022-06-09 11:41:21 +10:00
Sebastian Huber
d56d8a6069 termios06: Fix warning
Update #4493.
2022-04-28 09:37:49 +02:00
Sebastian Huber
8b18037f20 heap: Fix heap statistics with protection enabled
Close #4644.
2022-04-28 09:16:54 +02:00
Ryan Long
48d9dc6c89 libtests/dl06: Manually adding file headers and licenses.
These files had no header, copyright, or license. Based on git history,
added appropriate copyright and license.
2022-04-27 15:19:24 -05:00
Ryan Long
5b29f1ebc7 libtests: Adding file headers and licenses
These files had no file header, copyright, or license. Based on git
history, added appropriate copyrights and licenses.
2022-04-27 15:19:24 -05:00
Joel Sherrill
d1c10d6a1e testsuites/libtests/*/*.dts. stackchk02.doc: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
52a67757ef testsuites/libtests/[m-z]*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
33078a2bfb testsuites/libtests/[a-l]*: Change license to BSD-2
Updates #3053.
2022-04-12 13:35:39 -05:00
Joel Sherrill
acceb478ec testsuites/libtests/[p-z]*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Joel Sherrill
1ef07d4620 testsuites/libtests/[d-o]*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Joel Sherrill
366711fcfa testsuites/libtests/dl*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Joel Sherrill
85cc173d6e testsuites/libtests/[a-c]*: Change license to BSD-2
Updates #3053.
2022-04-07 08:38:56 -05:00
Matt Joyce
ea4d756672 newlib01: Added tests for exit procedures
Added tests for exit procedures to ensure proper resource
cleanup. The test now checks cleanup for files assigned
to stdio streams and non-stdio streams.
2022-03-31 17:19:39 +02:00
Joel Sherrill
c9625a21ac testsuites/: Update Eric Norum contact info and normalize file headers 2022-03-24 10:01:51 -05:00
Sebastian Huber
3345415211 newlib01: Adjust variable name 2022-03-24 11:10:48 +01:00
Matt Joyce
c82eb0b0fb newlib01: Check exit processing for file objects 2022-03-24 11:06:22 +01:00
Christian Mauderer
5028a9f6c4 testsuites: Manual file header clean up
Updates #4625.
2022-03-10 09:15:19 +01:00
Joel Sherrill
bbe71c611b bsps/testsuites/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:50 +01:00
Joel Sherrill
5fbb477952 testsuites/.../*doc: Manual cleanup of embedded brains File Headers
There were not a lot of these and they did not match the patterns
of the C.

Updates #4625.
2022-03-10 08:43:49 +01:00
Matt Joyce
d24da94f62 newlib01: Edit asserts to check initialization
Edit assert statements in worker thread to check initialization against the
__cleanup member of struct _reent instead of __sdidinit.  This will allow the
removal of sdidinit in a follow up Newlib patch.
2022-02-16 08:25:42 +01:00
Kinsey Moore
b539af865e cpukit: Prevent error with disabled stack checker
When the stack checker is not enabled, the stack checker reporting
function can still be called. This prevents that call from performing a
null memory access in trying to find the high water mark if the stack
checker was never initialized.

This also introduces a test to ensure this call does not cause a crash.

Closes #4588
2022-01-27 13:07:30 -06:00
Sebastian Huber
2145e0c7bf Remove obsolete rtems_gxx_*() implementation
GCC versions prior to 6.1 used a RTEMS thread model based on
rtems_gxx_*() functions. GCC version 6.1 or later uses the
self-contained synchronization objects of Newlib <sys/lock.h> for the
RTEMS thread model.

Remove the obsolete implementation.

Close #3143.
2022-01-27 11:06:46 +01:00
Sebastian Huber
93ebc9da69 libtests/dl10: Enter shell on demand
Use rtems_shell_wait_for_input() similar to other potentially
interactive test programs.
2022-01-14 08:02:38 +01:00
Sebastian Huber
671f126a3a libtests/ofw01: Fix device tree blob alignment
A device tree blob must be aligned on an 8-byte boundary.
2022-01-13 15:15:52 +01:00
Sebastian Huber
00081b30a8 Fix device tree blob alignment
A device tree blob must be aligned on an 8-byte boundary.
2022-01-11 18:01:17 +01:00
Sebastian Huber
963a26c34b libtests/ofw01: Fix wrapped in bsp_fdt_get()
Use the stack pointer to check if we have to return the real device tree
since bsp_fdt_get() may get called before the BSS is cleared to zero.
2022-01-11 16:18:11 +01:00
Christian Mauderer
ffc57e3cf3 untar: Make behavior similar to GNU or BSD tar
RTEMS untar implementation had problems with overwriting or integrating
archives into existing directory structures. This patch adapts the
behavior to mimic that of a GNU tar or BSD tar and extends the tar01
test to check for the behavior. That is:

* If a directory structure exists, the files from the archive will be
  integrated. Existing files are overwritten.

* If a file exists and the archive contains a directory with the same
  name, the file is removed and a directory is created. In the above
  example: if l1/l2 is a file it will be overwritten with a new
  directory.

* If a directory exists and the archive contains a file with the same
  name, the directory will be replaced if it is empty. If it contains
  files, the result is an error.

* An archive also can contain only a file without the parent
  directories. If in that case one of the parent directories exists as a
  file extracting the archive results in an error. In the example: if
  l1/l2 is a file and the archive doesn't contain the directories but
  only the file l1/l2/x.txt that would be an error.

* In case of an error, it is possible that the archive has been
  partially extracted.

Closes #4568
2021-12-09 08:23:47 +01:00
Sebastian Huber
d7205f0083 libc: Optimize malloc() initialization
The BSPs provide memory for the separate C Program Heap initialization
via _Memory_Get().  Most BSPs provide exactly one memory area.  Only two
BSPs provide more than one memory area (arm/altera-cyclone-v and
bsps/powerpc/mpc55xxevb).  Only if more than one memory area is
provided, there is a need to use _Heap_Extend().  Provide two
implementations to initialize the separate C Program Heap and let the
BSP select one of the implementations based on the number of provided
memory areas.  This gets rid of a dependency on _Heap_Extend().  It
also avoids dead code sections for most BSPs.

Change licence to BSD-2-Clause according to file history.

Update #3053.
2021-11-30 08:33:12 +01:00
Sebastian Huber
9b6362da71 rtems: Use RTEMS_WHO_AM_I for rtems_task_ident() 2021-11-18 19:59:14 +01:00
zack leung
19c101281a libtests/calloc.c: Fix reported memory leak
This fix came from Code Inspector, flagged by one of the analysis that
was done.

This test code is compiled only but better to address the issues so
future static analysis reports will not include it.
2021-11-03 08:39:12 -05:00
Sebastian Huber
db8f598d56 build: Remove old build system
Close #3250.
Close #4081.
2021-09-21 07:39:09 +02:00
Christian Mauderer
5bb5e01356 i2c: Add non blocking read / write
This adds the possibility to open an I2C bus with O_NONBLOCK (or set it
later via fcntl) to get non-blocking transmissions. This means that if
the bus is busy, a read, write or transfer ioctl will return with a
EAGAIN errno.
2021-06-22 13:51:17 +02:00
Vijay Kumar Banerjee
a5fd2935b7 testsuites: Remove telnetd01
telnetd01 test cannot be run without a network stack, so this test is being
moved to the rtems-net-legacy repository.
2021-05-20 17:52:37 -06:00
Sebastian Huber
2c5199bb04 Return NULL for zero size allocations
In POSIX, zero size memory allocations are implementation-defined
behaviour.  The implementation has two options:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html

https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html

Linux and FreeBSD return a unique pointer for zero size memory
allocations.   Return NULL on RTEMS to more likely catch the use of a
zero size memory area by erroneous applications.

Update #4390.
2021-05-06 08:03:58 +02:00
Sebastian Huber
d692c62dfb Make zero size allocation result consistent
The zero size allocations had no consistent behaviour in RTEMS.  For
example, malloc( 0 ) returned NULL and posix_memalign( &p, align, 0 )
returned in p a unique pointer (or NULL if no memory is available).  In
POSIX, zero size memory allocations are implementation-defined
behaviour.  The implementation has two options:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html

https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html

Linux and FreeBSD return a unique pointer for zero size memory
allocations.   Use this approach for RTEMS as well throughout the memory
allocation directives

Close #4390.
2021-05-04 09:37:06 +02:00
Sebastian Huber
5b97821bc8 libtest: Fix use of flexible array member
Flexible array members must not appear in the middle of a structure.
2021-05-03 06:58:53 +02:00
Vijay Kumar Banerjee
e29d5cd01d Makefile.am: Remove legacy networking files 2021-04-26 07:59:08 -06:00
Sebastian Huber
51defd9274 Fix calloc() behaviour in case of overflow
The multiplication to calculate the length of the memory area to
allocate may overflow.  Return NULL in case of an overflow.

Close #4389.
2021-04-20 20:33:03 +02:00
Vijay Kumar Banerjee
650ac70066 Revert "cpukit: Remove telnetd"
This reverts commit 3299dda245.
2021-04-13 11:57:21 -06:00
Vijay Kumar Banerjee
df6d765c3a testsuites: Remove all legacy networking tests
Update #3850
2021-04-07 16:15:39 -06:00
Vijay Kumar Banerjee
3299dda245 cpukit: Remove telnetd
Update #3850
2021-04-07 16:15:39 -06:00
Vijay Kumar Banerjee
3dca9ed92b testsuites/libtests: Remove networking01
Update #3850
2021-04-07 16:15:38 -06:00
Sebastian Huber
b3364fc6cb libtests/block14: Fix warning
Fix warning:

testsuites/libtests/block14/init.c:198:8: warning: 'sc' may be used
  uninitialized in this function [-Wmaybe-uninitialized]

Update #3689.
2021-04-07 06:41:09 +02:00
Jiri Gaisler
4f12a1e365 Restore FDT in ofw01 to avoid test timeout on RISCV 2021-03-30 16:34:04 +02:00
Christian Mauderer
6ae79e6df6 libblock: Add rtems_bdbuf_peek()
Adds a peek function that allows (for example) a file system to suggest
the next blocks that should be used for read ahead. This can increase
the read speed of fragmented files.

Update #3689
2021-03-26 14:25:38 +01:00
Sebastian Huber
c96644e873 libtest: Print SHA256 hash in base64url 2021-02-26 09:10:09 +01:00
Sebastian Huber
74eff26c1d libtest: Report target hash
Update #4267.
2021-02-26 09:10:09 +01:00
G S Niteesh Babu
f867e7b6f4 libtests/ofw01: Added a test for RTEMS OFW
This commit adds a basic test that tests all the implemented
RTEMS OFW functions.
2020-12-27 10:05:09 +01:00
Sebastian Huber
eae22cc03e libtest: Make test case allocator configurable 2020-11-19 08:39:02 +01:00