mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-02 14:04:27 +00:00
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>
22 lines
593 B
Bash
Executable File
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" "⁉ 🌈"
|