A HID application can no longer write to the default
interrupt IN endpoint because the addresses are assigned
dynamically. Add hid_int_ep_write() function and leave
it to the hid-core to call the usb_write() with the correct
endpoint address.
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
For some reason %F wasn't supported initially. Its simple enough to
handle the case difference in infinity and NaN handling to add support
for %F.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The C standard says that %f should use '[-]inf' or '[-]infinity' (which
style is implementation defined) for infinity handling and '[-]nan' for
NaN.
We where adding a '+' and had the wrong case for 'inf' and 'nan'.
Before -> After
+INF -> inf
-INF -> -inf
NaN -> nan
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
For %{e,E,g,G} conversion specifiers the C standard says the exponent
contains at least two digits, and only as many digits are necessary. So
instead of 1.234000e-001 we should have 1.234000e-01.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Updated test description for tickless test cases, grouped test cases
as per doxygen requirements and some uncrustify's cosmetic changes.
Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
The new JSON_OBJ_DESCR_ARRAY_ARRAY allows use of an array of
array. The macro is based on the comments and directions provided by
Leandro Pereira <leandro.pereira@intel.com> (in #8567).
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br>
The cb_[1|2]_called variables were initialized just before running
the test. This was too late as in some cases the Trickle timer
was triggered before the variables were init, which then caused the
test to fail even though there was no actual timer failure.
This was seen with frdm_k64f and when CONFIG_BOOT_DELAY=1000 was set.
Fixes#8658
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The return value from the k_mem_slab_alloc was not read. Hence
adding code to make use of this return value.
Fixes: GH-6681
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
The problem is that net_if_call_timestamp_cb only checked if the
callback was registered for the PORT which invoked the whole action.
There is a possibility, that the callback will be registered, and packet
A will be passed to eth driver. Before the driver is finished with
packet A, network layer will start handling another packet (B) - so it
will unregister the callback for packet A and register it for B. After
that the network driver will finish processing packet A and invoke the
timestamp callback. The mechanism would then only check if a callback is
registered for the port of the driver and invoke the callback for the
packet that was registered earlier (so A instead of B).
This commit fixes that by storing info not only about the port but about
the packet too.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
The current test expects particular order of cap_webusb and cap_msosv2
structures, create alternative structure for comparison.
Fixes: #8732
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Updated ztest_mock.c to support multiple calls to same mock function
within a single function under test. This allows sequencing mock
return values for improved decision coverage in a test, or simply
when a given function under test calls the same function more than
once with different parameters, or different return values.
Signed-off-by: Morten Priess <mtpr@oticon.com>
If the sys_rand32_get() returns large value, then we might
decrement the clock which is not intended in this test.
Fixes#8657
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add a new test to make I2C transfers between an I2C controller and
an I2C slave driver, either by:
- Using a virtual I2C driver
- Using a physical link and 2 physical controllers
The Physical test uses :
- Two EEPROM Slave drivers each connected to one I2C controller
- Both I2C controllers also act as master and take turns writing
to the opposite EEPROM Slave.
All of this connected physically on the board.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Daniel Wagenknecht <wagenknecht@clage.de>
The kernel incorrectly assumed, that system timer frequency is always
divisible without remainder by couple "natural" tick rates (like 100).
As result on some SoCs, time calculations was not correct, producing
strange effects (invalid sleep times, incorrect k_uptime_get() etc.).
This commit enables accurate, but costly (using 64-bit math) tick <-> ms
conversion if the selected tick interval is not exact due to hardware
limitations.
Also, this commit fixes tests in which removed _ms_per_tick were used.
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
These two tests ask for lots of priority levels, more than the 32
maximum allowed by SCHED_MULTIQ (which is by design: if you have
requirements like that DUMB or SCALABLE are better choices due to the
RAM overhead of MULTIQ), so the build will fail on boards that defined
MULTIQ as default.
Don't let the platform choose the scheduler backend, ask for SCALABLE
explicitly.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Now that it is possible to easily add Kconfig options from command
line, we do not need to always compile native_posix with coverage.
This was done only to have it set easily for sanity_check.
So do not select it anymore, and let users choose if they
want coverage dumps or not.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Split out definition of net_app_init() and its parameter flags from
net_app.h header to new net_config.h header. As we do this, rename
the function to net_config_init() and flags to NET_CONFIG_NEED_*.
This is a second step in splitting out network configuration API
out of net_app API, started in the c60df1311 commit.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Introduce TC_RESULT_TO_STR to convert from an integer test result to a
string like "PASS", "FAIL", "SKIP". Do this to remove the defines of
PASS/FAIL/SKIP since those names might get used by other code and to
have a single consistent way of doing the conversion.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This test is failing for the frdm platform because
the ADC_DEVICE_NAME is different. Add #if statements
to correct for respective platform names.
Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
GCC 7 and newer are smart enough to realize that in test_snprintf()
the output will not fit in 0 or 4 bytes, but that it requires 9.
So it throws a warning in compile time. But in this case we are
actually testing that snprintf's return value is what it should be
while truncating the output. So let's suppress this warning here.
Fixes: #5732
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Exclude building the btshell and mesh_shell application for
NRF52810_PCA10040 boards due to limited RAM and Flash
availability on the nRF52810 SoC.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The test verifies that the mock framework can handle functions
under test which call more than one mock function, and
correctly processes each call.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Calling __builtin_ffsl(neg_bitmap) returns first bit set in the word,
e.g. 4 if bitmap is 11111000. As this must translate to zero-based index
3, one must be subtracted from the result.
Signed-off-by: Morten Priess <mtpr@oticon.com>
It is not necessary to link 'app' with mbedTLS because mbedTLS is
covered by the 'APP_LINK_WITH_MBEDTLS' mechanism that automatically
links 'app' with mbedTLS.
This patch removes the redundant target_link_libraries invocations.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The SSE and SSE_FP_MATH configs exist only in the x86 architecture, so
extract them to a separate prj_x86.conf file for the fp_sharing test.
Fixes Kconfig warnings when building the test for frdm_k64f:
- warning: attempt to assign the value "y" to the undefined symbol SSE
- warning: attempt to assign the value "y" to the undefined symbol
SSE_FP_MATH
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
When adding the nRF52810, which has 24KB of RAM, some of the tests don't
compile anymore due to lack of SRAM. Address this by either filtering
the test out or reducing the amount of memory allocation.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Bool symbols implicitly default to 'n'.
A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Test that Tx timestamp callback code is called properly if network
packet timestamping is enabled.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Remove the CMakeLists.txt file that is in the 'common' directory of
nffs_fs_api. It has likely been added by mistake as it does not make
any sense as it is written.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
All architecture defines OCTET_TO_SIZEOFUNIT and SIZEOFUNIT_TO_OCTET
as identity functions. But the only user is tests/benchmarks/app_kernel.
It's effectively a no-op. Remove them.
Signed-off-by: Yasushi SHOJI <y-shoji@ispace-inc.com>
UART_PIPE_ON_DEV_NAME is set to UART_1 by default in
boards/arm/qemu_cortex_m3/qemu_cortex_m3.dts
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>