]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/powerpc: Add test for strlen()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Wed, 1 Aug 2018 09:01:12 +0000 (09:01 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 Aug 2018 11:49:30 +0000 (21:49 +1000)
commit8fbf710796beab75fc1aee336fbf8cf0e81f07c5
tree408b80cf6f30bac7f4723a8ce30a3bc5ae5e215c
parent1ce5fef1d9479c4d6a39ed48b3fc67a73a4ae854
selftests/powerpc: Add test for strlen()

This patch adds a test for strlen()

string.c contains a copy of strlen() from lib/string.c

The test first tests the correctness of strlen() by comparing
the result with libc strlen(). It tests all cases of alignment.

It them tests the duration of an aligned strlen() on a 4 bytes string,
on a 16 bytes string and on a 256 bytes string.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
[mpe: Drop change log from copy of string.c]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
tools/testing/selftests/powerpc/stringloops/Makefile
tools/testing/selftests/powerpc/stringloops/string.c [new file with mode: 0644]
tools/testing/selftests/powerpc/stringloops/strlen.c [new file with mode: 0644]