123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
-
-
- #include "config.h"
-
- #include <assert.h>
- #include <stdlib.h>
- #include <string.h>
-
- #include <espeak-ng/espeak_ng.h>
- #include <espeak-ng/speak_lib.h>
- #include <espeak-ng/encoding.h>
-
- #include "speech.h"
- #include "phoneme.h"
- #include "synthesize.h"
- #include "translate.h"
-
- void
- test_espeak_terminate_without_initialize()
- {
- printf("testing espeak_Terminate without espeak_Initialize\n");
-
- assert(event_list == NULL);
- assert(translator == NULL);
- assert(p_decoder == NULL);
-
- assert(espeak_Terminate() == EE_OK);
- assert(event_list == NULL);
- assert(translator == NULL);
- assert(p_decoder == NULL);
- }
-
- void
- test_espeak_initialize()
- {
- printf("testing espeak_Initialize\n");
-
- assert(event_list == NULL);
- assert(translator == NULL);
- assert(p_decoder == NULL);
-
- assert(espeak_Initialize(AUDIO_OUTPUT_PLAYBACK, 0, NULL, 0) == 22050);
- assert(event_list != NULL);
- assert(translator == NULL);
- assert(p_decoder == NULL);
-
- assert(espeak_Terminate() == EE_OK);
- assert(event_list == NULL);
- assert(translator == NULL);
- assert(p_decoder == NULL);
- }
-
- void
- test_espeak_synth()
- {
- printf("testing espeak_Synth\n");
-
- assert(event_list == NULL);
- assert(translator == NULL);
- assert(p_decoder == NULL);
-
- assert(espeak_Initialize(AUDIO_OUTPUT_RETRIEVAL, 0, NULL, 0) == 22050);
- assert(event_list != NULL);
- assert(translator == NULL);
- 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(p_decoder != NULL);
-
- assert(espeak_Synchronize() == EE_OK);
- assert(translator != NULL);
- assert(p_decoder != NULL);
-
- assert(espeak_Terminate() == EE_OK);
- assert(event_list == NULL);
- assert(translator == NULL);
- assert(p_decoder == NULL);
- }
-
- int
- main(int argc, char **argv)
- {
- test_espeak_terminate_without_initialize();
- test_espeak_initialize();
-
- test_espeak_synth();
- test_espeak_synth();
-
- return EXIT_SUCCESS;
- }
|