Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/tests/clibrary.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ int main()

SPDConnection *conn;
int i, ret;
char *error;

printf("Start of the test of the test.\n");

printf("Trying to initialize Speech Daemon...\n");
conn = spd_open("say", NULL, NULL, SPD_MODE_SINGLE);
conn = spd_open2("say", NULL, NULL, SPD_MODE_SINGLE, NULL, 1, &error);
if (conn == 0) {
printf("Speech Daemon failed.\n");
printf("Speech Daemon failed:\n%s\n", error);
exit(1);
}
printf("OK\n");
Expand Down
11 changes: 6 additions & 5 deletions src/tests/clibrary2.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ int main()
char **voices;
char *module;
char *language;
char *error;
int value;
SPDVoiceType voice_type = SPD_CHILD_MALE;
SPDVoice **synth_voices;
Expand All @@ -72,15 +73,15 @@ int main()
printf("Start of the test.\n");

printf("Trying to initialize Speech Daemon...\n");
conn = spd_open("say", NULL, NULL,
conn = spd_open2("say", NULL, NULL,
#ifdef THOROUGH
SPD_MODE_THREADED
SPD_MODE_THREADED,
#else
SPD_MODE_SINGLE
SPD_MODE_SINGLE,
#endif
);
NULL, 1, &error);
if (conn == 0) {
printf("Speech Daemon failed\n");
printf("Speech Daemon failed:\n%s\n", error);
exit(1);
}
printf("OK\n");
Expand Down
10 changes: 7 additions & 3 deletions src/tests/connection-recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ SPDConnection *try_to_reconnect(void)
{
SPDConnection *conn;
while (1) {
char *error;
printf("Trying to reconnect\n");
usleep(1000);
conn = spd_open("test", NULL, NULL, SPD_MODE_THREADED);
conn = spd_open2("test", NULL, NULL, SPD_MODE_THREADED, NULL, 1, &error);
if (conn != NULL) {
spd_say(conn, SPD_MESSAGE, "Reconnect successful");
printf("Reconnect successful\n");
return conn;
}
printf("Reconnect failed:\n%s\n", error);
free(error);
}
}

Expand All @@ -53,10 +56,11 @@ int main(void)
int i = 0;
int failures = 0;
int ret;
char *error;

conn = spd_open("test", NULL, NULL, SPD_MODE_THREADED);
conn = spd_open2("test", NULL, NULL, SPD_MODE_THREADED, NULL, 1, &error);
if (conn == 0) {
printf("Speech Daemon failed\n");
printf("Speech Daemon failed:\n%s\n", error);
exit(1);
}

Expand Down
5 changes: 3 additions & 2 deletions src/tests/long_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ int main()
{
SPDConnection *sockfd;
int ret;
char *error;

printf("Start of the test.\n");

printf("Trying to initialize Speech Dispatcher...\n");
sockfd = spd_open("test", NULL, NULL, SPD_MODE_SINGLE);
sockfd = spd_open2("test", NULL, NULL, SPD_MODE_SINGLE, NULL, 1, &error);
if (sockfd == 0) {
printf("Speech Dispatcher failed\n");
printf("Speech Daemon failed:\n%s\n", error);
exit(1);
}
printf("OK\n");
Expand Down
5 changes: 3 additions & 2 deletions src/tests/spd_cancel_long_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ static void notification_cb(size_t msg_id, size_t client_id,
int main(int argc, char *argv[])
{
int result, count;
char *error;

/* Open Speech Dispatcher connection */
spd = spd_open(TEST_NAME, __FUNCTION__, NULL, SPD_MODE_THREADED);
spd = spd_open2(TEST_NAME, __FUNCTION__, NULL, SPD_MODE_THREADED, NULL, 1, &error);
if (!spd) {
printf("Speech-dispatcher: Failed to open connection. \n");
printf("Speech-dispatcher: Failed to open connection:\n%s\n", error);
exit(1);
}

Expand Down
5 changes: 3 additions & 2 deletions src/tests/spd_set_notifications_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ void index_mark_cb(size_t msg_id, size_t client_id, SPDNotificationType type,
int main(int argc, char *argv[])
{
int result, count;
char *error;

/* Open Speech Dispatcher connection in THREADED mode. */
spd = spd_open(TEST_NAME, __FUNCTION__, NULL, SPD_MODE_THREADED);
spd = spd_open2(TEST_NAME, __FUNCTION__, NULL, SPD_MODE_THREADED, NULL, 1, &error);
if (!spd) {
printf("Speech-dispatcher: Failed to open connection. \n");
printf("Speech-dispatcher: Failed to open connection:\n%s\n", error);
exit(1);
}

Expand Down
Loading