Fix undefined behavior in tests

15 jobs for master in 33 minutes and 59 seconds (queued for 1 second)
Status Name Job ID Coverage
  Static Test
passed clang-format #914593
linux elsa clang

00:00:16

passed clang-tidy #914594
linux elsa clang

00:00:25

 
  Compile
passed build-clang #914597
linux elsa clang

00:00:32

passed build-cuda #914598
linux elsa gcc cuda

00:00:34

passed build-gcc #914596
linux elsa gcc

00:00:32

passed build-gpu-only #914599
linux elsa gcc cuda

00:00:38

passed build-ubuntu #914595
linux elsa

00:00:30

 
  Test
passed test-clang #914602
linux elsa clang

00:06:18

passed test-cuda #914603
linux elsa gcc cuda

00:06:32

passed test-gcc #914601
linux elsa gcc

00:06:35

passed test-gpu-only #914604
linux elsa gcc cuda

00:09:15

passed test-ubuntu #914600
linux elsa

00:05:58

 
  Coverage
passed test-coverage #914605
linux elsa gcc cuda

00:22:28

96.9%
 
  Sanitizer
passed cuda-memcheck #914606
linux elsa gcc cuda

00:00:46

 
  Docs
passed deploy-docs #914607
elsa-docs-deploy

00:00:23