zephyr/tests/kernel
Andy Ross 6a1f721dda tests/kernel/workq: Fix semaphore counting
This test case will call k_sem_give() twice and expect both to be
received by k_sem_take(), yet the semaphore is initialized with a
maximum count of one!

The reason this worked was an undocumented misfeature of k_sem: if
k_sem_take() was called on a semaphore with a pended thread, it would
wake up that thread synchronously instead of incrementing the count.
So you could call it once to wake up the thread and again to queue the
count and not overflow.  The problem is that this is a priority bug (a
high priority runnable thread should have the chance to run and call
k_sem_take() before a low priority thread that got woken).

Zync corrects that, and so needs to have two slots if you want two
semaphore events.

Signed-off-by: Andy Ross <andyross@google.com>
2022-10-17 10:13:56 +02:00
..
common tests: kernel/common: IRQ offload test if CONFIG_IRQ_OFFLOAD=y 2022-10-08 18:33:14 +02:00
condvar/condvar_api test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
context tests/kernel/context: don't do print in time-critical section 2022-10-11 11:11:45 +02:00
device ztest: improve some tests 2022-09-09 07:05:38 -04:00
early_sleep tests: kernel: early_sleep: move to new ztest API 2022-08-23 20:57:04 -04:00
events ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
fatal includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
fifo ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
fpu_sharing ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
gen_isr_table Revert "tests: kernel: gen_isr_table: Disable RISC-V direct ISR test" 2022-09-08 10:39:31 +02:00
interrupt Revert "tests: kernel: interrupt: Disable on ARM64 QEMU targets" 2022-09-23 12:10:25 +02:00
lifo ztest: improve some tests 2022-09-09 07:05:38 -04:00
mbox ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
mem_heap ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
mem_protect tests: mem_protect: sys_sem: move a test case to new ztest API 2022-09-22 16:42:51 +00:00
mem_slab ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
mp tests: kernel: move the multiprocessing test to new ztest 2022-08-11 12:19:59 +02:00
msgq ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
mutex tests: kernel: mutex: test for lock timeout race 2022-09-30 09:45:37 +00:00
obj_tracking tests: Add CONFIG_PIPES to tests that use pipes 2022-08-17 19:31:25 +02:00
pending test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
pipe ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
poll ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
profiling/profiling_api test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00
queue ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
sched ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
semaphore tests/semaphore: fix "cpu test took too long" assertion failure 2022-09-28 07:53:56 +00:00
sleep includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
smp tests/kernel/smp: Correct parameter name 2022-09-19 09:19:02 +02:00
smp_boot_delay includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
spinlock includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
stack/stack ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
threads init: remove _SYS_INIT_LEVEL* definitions 2022-10-12 18:49:12 +09:00
tickless/tickless_concept tests: kernel: tickless: Don't run on nucleo_l073rz 2022-09-21 18:39:07 +00:00
timer tests: Tick rate testing with timer train 2022-10-12 20:42:22 -04:00
usage/thread_runtime_stats ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
workq tests/kernel/workq: Fix semaphore counting 2022-10-17 10:13:56 +02:00
xip test: fix more legacy #include paths 2022-08-02 16:41:41 +01:00