Files
espeak-ng/tests/phoneme-output.test
T
Reece H. Dunn 119c200e00 Use strcpy instead of memcpy+strlen.
This replaces uses of:

	memcpy(dst, src, strlen(src))

with:

	strcpy(dst, src)

This fixes issues with reading past the end of the copied buffer
(e.g. when processing word-based replacements for emoji characters)
by ensuring that the destination buffer is null terminated.

Reported by Michael Curran <mick@nvaccess.org>
2017-10-01 08:50:56 +01:00

22 lines
593 B
Bash
Executable File

#!/bin/sh
test_phonemes() {
TEST_LANG=$1
EXPECTED=$2
TEST_TEXT=$3
echo "testing ${TEST_LANG} \"${TEST_TEXT}\""
ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
src/espeak-ng -xq -v ${TEST_LANG} "${TEST_TEXT}" > actual.txt
echo "${EXPECTED}" > expected.txt
diff expected.txt actual.txt || exit 1
}
test_phonemes en " h@l'oU" "hello"
# Emoji
# ED-3 - emoji_character [http://www.unicode.org/reports/tr51/tr51-12.html#def_emoji_character]
test_phonemes en " Ekskla#m'eIS@N kw'EstS@n m'A@k" "⁉"
test_phonemes en " Ekskla#m'eIS@N kw'EstS@n m'A@k r'eInboU" "⁉ 🌈"