Browse Source

tests/api: test that the translator's dictionary is correct.

master
Reece H. Dunn 8 years ago
parent
commit
c0308e3140
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      tests/api.c

+ 9
- 0
tests/api.c View File

@@ -88,10 +88,12 @@ test_espeak_synth()
const char *test = "One two three.";
assert(espeak_Synth(test, strlen(test)+1, 0, POS_CHARACTER, 0, espeakCHARS_AUTO, NULL, NULL) == EE_OK);
assert(translator != NULL);
assert(strcmp(translator->dictionary_name, "en") == 0);
assert(p_decoder != NULL);

assert(espeak_Synchronize() == EE_OK);
assert(translator != NULL);
assert(strcmp(translator->dictionary_name, "en") == 0);
assert(p_decoder != NULL);

assert(espeak_Terminate() == EE_OK);
@@ -153,10 +155,12 @@ test_espeak_set_voice_by_name_null_voice()
const char *test = "One two three.";
assert(espeak_Synth(test, strlen(test)+1, 0, POS_CHARACTER, 0, espeakCHARS_AUTO, NULL, NULL) == EE_OK);
assert(translator != NULL);
assert(strcmp(translator->dictionary_name, "en") == 0);
assert(p_decoder != NULL);

assert(espeak_Synchronize() == EE_OK);
assert(translator != NULL);
assert(strcmp(translator->dictionary_name, "en") == 0);
assert(p_decoder != NULL);

assert(espeak_Terminate() == EE_OK);
@@ -186,10 +190,12 @@ test_espeak_set_voice_by_name_blank_voice()
const char *test = "One two three.";
assert(espeak_Synth(test, strlen(test)+1, 0, POS_CHARACTER, 0, espeakCHARS_AUTO, NULL, NULL) == EE_OK);
assert(translator != NULL);
assert(strcmp(translator->dictionary_name, "en") == 0);
assert(p_decoder != NULL);

assert(espeak_Synchronize() == EE_OK);
assert(translator != NULL);
assert(strcmp(translator->dictionary_name, "en") == 0);
assert(p_decoder != NULL);

assert(espeak_Terminate() == EE_OK);
@@ -214,15 +220,18 @@ test_espeak_set_voice_by_name_valid_voice()

assert(espeak_SetVoiceByName("de") == EE_OK);
assert(translator != NULL);
assert(strcmp(translator->dictionary_name, "de") == 0);
assert(p_decoder == NULL);

const char *test = "One two three.";
assert(espeak_Synth(test, strlen(test)+1, 0, POS_CHARACTER, 0, espeakCHARS_AUTO, NULL, NULL) == EE_OK);
assert(translator != NULL);
assert(strcmp(translator->dictionary_name, "de") == 0);
assert(p_decoder != NULL);

assert(espeak_Synchronize() == EE_OK);
assert(translator != NULL);
assert(strcmp(translator->dictionary_name, "de") == 0);
assert(p_decoder != NULL);

assert(espeak_Terminate() == EE_OK);

Loading…
Cancel
Save