aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/ir/ir_loopback.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-02-13selftests: ir: skip when lirc device doesn't exist.Shuah Khan1-1/+1
Skip instead of fail when lirc device doesn't exist. Signed-off-by: Shuah Khan <shuah@kernel.org> Acked-by: Sean Young <sean@mess.org> Signed-off-by: Shuah Khan <shuah@kernel.org>
2019-02-13selftests: ir: fix warning: "%s" directive output may be truncated ’ directive output may be truncatedShuah Khan1-1/+3
Fix the following warning by sizing the buffer to max. of sysfs path max. size + d_name max. size. gcc -Wall -O2 -I../../../include/uapi ir_loopback.c -o ../tools/testing/selftests/ir/ir_loopback ir_loopback.c: In function ‘lirc_open’: ir_loopback.c:71:37: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 95 [-Wformat-truncation=] snprintf(buf, sizeof(buf), "/dev/%s", dent->d_name); ^~ In file included from /usr/include/stdio.h:862:0, from ir_loopback.c:14: /usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 6 and 261 bytes into a destination of size 100 return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __bos (__s), __fmt, __va_arg_pack ()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Shuah Khan <shuah@kernel.org> Acked-by: Sean Young <sean@mess.org> Signed-off-by: Shuah Khan <shuah@kernel.org>
2018-11-06media: rc: self test for IR encoders and decodersSean Young1-0/+199
ir-loopback can transmit IR on one rc device and check the correct scancode and protocol is decoded on a different rc device. This can be used to check IR transmission between two rc devices. Using rc-loopback, we use it to check the IR encoders and decoders themselves. No hardware is required for this test. Signed-off-by: Sean Young <sean@mess.org> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Shuah Khan <shuah@kernel.org>