To be able to get a tokenize DT string without the quotes. Deprecate
also DT_ENUM_TOKEN and DT_ENUM_UPPER_TOKEN.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
`_FOREACH_` macros do not allow the caller to pass additional arguments
to the `fn`. A series of `_VARGS` variants have been added that allow
the caller to pass arbitrary number of arguments to the `fn`:
```
DT_FOREACH_CHILD_VARGS
DT_FOREACH_CHILD_STATUS_OKAY_VARGS
DT_FOREACH_PROP_ELEM_VARGS
DT_INST_FOREACH_CHILD_VARGS
DT_INST_FOREACH_STATUS_OKAY_VARGS
DT_INST_FOREACH_PROP_ELEM_VARGS
```
Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
This commit increases the heap size for the newlib nano test to 2048,
which is the recommended minimum required to ensure proper operation
(see #35799).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
As we don't use memory allocated in test_calloc, test_no_mem_malloc,
and test_no_mem_realloc. malloc call can be optimized away (that really
happens with ARC MWDT toolchain). That breaks the test. So disable
optimization for these functions.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
The coverity report "Out-of-bounds access". The reason is
The room of src and dest buffer is less than the count wanted
to be copyied. So enlarged the src and dest buffer to solve this
issue.
Fixes:#35345
Fixes:#35346
Signed-off-by: Ying ming <mingx.ying@intel.com>
1. Refine some testcases for testing some character output function.
2. Delete some negative testcases which will not invoke fatal error.
Fixes#33822Fixes#33803Fixes#33801Fixes#33800Fixes#33790
Signed-off-by: Ying ming <mingx.ying@intel.com>
This commit adds a new test to verify the thread safety of the C
standard functions provided by newlib.
Only the memory management functions (malloc and free) are tested at
this time; this test will be further extended in the future, to verify
the thread safety and re-entrancy of all supported newlib functions.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
1. Refine some testcases for testing some libc functions, include
strlen(),strcmp(),strncmp(),memcmp(),memstr(),memcpy(),memmove()
strtol(),strtoul().
2. Change some code to make the code style consistent.
Fixes#33794Fixes#33810Fixes#33806
Signed-off-by: Ying ming <mingx.ying@intel.com>
Puts all filter in common section and fix filters. Platforms in
integration_platforms must also be allowed first, otherwise the tests
will never run.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Adding static to local functions. Using void * for %p argument
which often triggered compilation warning.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The devicetree test will not link the hsdk platforms as
when CONFIG_GPIO=y this enable CONFIG_I2C as the board utilizes
a GPIO expander over I2C. So we exclude building this test on
the hsdk platforms.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
These should run for minlibc configured with
CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE=0. In all other cases normal
testsuite should run.
How preprocessor #if's were put previously, some configurations,
e.g. prj_newlib.conf, had the testsuite completely skipped.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
It can be convenient to "iterate" over the elements of a property, in
the same way it is convenient to "iterate" over enabled instances.
Add a new macro for doing this, along with a DT_INST_FOREACH_PROP_ELEM
variant.
This is likely to be more convenient than UTIL_LISTIFY or FOR_EACH in
some situations because:
- it handles inputs of any length
- compiler error messages will be shorter and more self-contained
- it is easier to use with phandle-array type properties, which
require more complicated macro boilerplate when used with
util_macro.h APIs
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The vtable cannot point to address 1 as that is clearly not a
valid address and will fail when the code tries to access it
in various fdtable.c functions. Point the vtable in tests either
to NULL or to a valid vtable.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
3rd parameter (struct k_mutex *) was added to
z_get_fd_obj_and_vtable() so add it to calls in the tests.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add tests that validate the behaviour of providing NULL as a data
pointer to discard whatever data is in the ring buffer.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Add a testcase to test that read and write the
same buffer at the same time to check the
integrity of data reading and writing.
Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
CMSIS_DSP and net_socket tests are either too
slow or too large for this platform, also drop
bluetooth for test
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Fix 2 resource leaks issues of coverity scan, actually the return of
NULL pointer is expected, but there is no harm done to free a NULL
pointer in our design, so adding them to pass the scan.
Fixes#33802 CID: 220434
Fixes#33785 CID: 220451
Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
This is a helper which allows you to skip the intricacies of instance
numbers to express the intent of "give me a random enabled node with
this compatible; I don't care which one".
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add validation of the case when package buffer is not aligned to
CBPRINTF_PACKAGE_ALIGNMENT.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Fixing issue 219727. Potentially negative return value was passed
to a function that was expecting positive value.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Make sure that child bindings with their own compatibles are treated
as first-class bindings. Do this by making sure that nodes whose
bindings are defined via 'child-binding:' are picked up as bus nodes,
instead of a parent bus node of the same type.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Mark all variants of the DT_DMAS_LABEL APIs:
* DT_DMAS_LABEL_BY_IDX
* DT_DMAS_LABEL_BY_NAME
* DT_INST_DMAS_LABEL_BY_IDX
* DT_INST_DMAS_LABEL_BY_NAME
As deprecated in favor of utilizing:
* DT_DMAS_CTLR_BY_IDX
* DT_DMAS_CTLR_BY_NAME
* DT_DMAS_CTLR
* DT_INST_DMAS_CTLR_BY_IDX
* DT_INST_DMAS_CTLR_BY_NAME
* DT_INST_DMAS_CTLR
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The static device dependencies from devicetree are not the only ones
that might be present at runtime. Add API that allows visiting
required devices without assuming that handles for or pointers to them
can be accessed as a static contiguous sequence.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Extend test to validate cbprintf static packaging on various
platforms.
Added more test configurations: complete, nano, long double.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
CONFIG_KERNEL_COHERENCE forbids synchronized data on the stack: no
spinlocks, IPC primitives, or things that contain them. Application
code obviously doesn't have to follow these inconvenient rules, but
our test code needs to run on platforms with incoherent stack memory.
Make these things static.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Many platforms don't have a console backend, and this fails with a
kconfig warning if you try to build on them.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The code here was written to "get out of the way just long enough for
the trivial context switch and callback to execute". But on a machine
with 50 kHz ticks, that's not reliably enough time and this was
failing spuriously. Which would have been a reasonably forgivable
mistake to make had I not written this code with this very machine in
mind...
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Enable the CONFIG_TEST switch in the test suite.
This allows certain required Kconfig settings for
ARM Cortex-M (which depend on TEST) to be enabled
when executing the test suite.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This macro returns a node's name with unit-adddress, given its node
identifier.
The node name is useful information for the user to utilize for debug
information, similar to DT_NODE_PATH, or DT_LABEL.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>