|
|
@@ -37,9 +37,11 @@ test_espeak_terminate_without_initialize() |
|
|
|
printf("testing espeak_Terminate without espeak_Initialize\n"); |
|
|
|
|
|
|
|
assert(event_list == NULL); |
|
|
|
assert(translator == NULL); |
|
|
|
|
|
|
|
assert(espeak_Terminate() == EE_OK); |
|
|
|
assert(event_list == NULL); |
|
|
|
assert(translator == NULL); |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
@@ -48,12 +50,15 @@ test_espeak_initialize() |
|
|
|
printf("testing espeak_Initialize\n"); |
|
|
|
|
|
|
|
assert(event_list == NULL); |
|
|
|
assert(translator == NULL); |
|
|
|
|
|
|
|
assert(espeak_Initialize(AUDIO_OUTPUT_PLAYBACK, 0, NULL, 0) == 22050); |
|
|
|
assert(event_list != NULL); |
|
|
|
assert(translator == NULL); |
|
|
|
|
|
|
|
assert(espeak_Terminate() == EE_OK); |
|
|
|
assert(event_list == NULL); |
|
|
|
assert(translator == NULL); |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
@@ -62,16 +67,22 @@ test_espeak_synth() |
|
|
|
printf("testing espeak_Synth\n"); |
|
|
|
|
|
|
|
assert(event_list == NULL); |
|
|
|
assert(translator == NULL); |
|
|
|
|
|
|
|
assert(espeak_Initialize(AUDIO_OUTPUT_RETRIEVAL, 0, NULL, 0) == 22050); |
|
|
|
assert(event_list != NULL); |
|
|
|
assert(translator == 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(espeak_Synchronize() == EE_OK); |
|
|
|
assert(translator != NULL); |
|
|
|
|
|
|
|
assert(espeak_Terminate() == EE_OK); |
|
|
|
assert(event_list == NULL); |
|
|
|
assert(translator == NULL); |
|
|
|
} |
|
|
|
|
|
|
|
int |
|
|
@@ -81,6 +92,7 @@ main(int argc, char **argv) |
|
|
|
test_espeak_initialize(); |
|
|
|
|
|
|
|
test_espeak_synth(); |
|
|
|
test_espeak_synth(); // Check that this does not crash when run a second time. |
|
|
|
|
|
|
|
return EXIT_SUCCESS; |
|
|
|
} |