string: Speed up strcasecmp test data initialization
The strcasecmp and strncasecmp tests repeatedly initialize large
buffers for many combinations of lengths and alignments. The existing
loops perform a remainder operation and call toupper and tolower for
every element.
Generate at most max_char elements using an additive recurrence and
apply the case conversions while creating this initial pattern. The
recurrence produces the same sequence as the existing multiplication
and remainder expression. Expand the completed pattern using bulk
copies.
This preserves the generated test data and locale-dependent case
conversion while substantially reducing the initialization cost on
slower systems.
Signed-off-by: Magnus Lindholm <linmag7@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>