Add more tests for client registration code in test.cpp.

This commit is contained in:
Stephane Letz 2013-01-26 19:04:15 +01:00
parent c1f057e013
commit 76491d3bc5
1 changed files with 22 additions and 11 deletions

View File

@ -718,7 +718,6 @@ int main (int argc, char *argv[])
}
}
/**
* try to register another one with the same name...
*
@ -980,13 +979,12 @@ int main (int argc, char *argv[])
printf("!!! ERROR !!! Jack_Port_Rename_Callback was not called !!.\n");
}
/**
* Test if port registration callback have been called.
*
*/
jack_sleep(1 * 1000);
jack_sleep(1 * 1000); // To hope all port registration and reorder callback have been received...
if (1 == port_callback_reg) {
Log("%i ports have been successfully created, and %i callback reg ports have been received... ok\n", 1, port_callback_reg);
@ -1320,6 +1318,8 @@ int main (int argc, char *argv[])
a++;
}
jack_sleep(1 * 1000); // To hope all port registration and reorder callback have been received...
// Check port registration callback again
if (j == port_callback_reg) {
Log("%i ports have been successfully created, and %i callback reg ports have been received... ok\n", j, port_callback_reg);
@ -1353,10 +1353,21 @@ int main (int argc, char *argv[])
exit(1);
}
// Check client registration callback
jack_sleep(1000);
if (client_register == 0)
printf("!!! ERROR !!! Client registration callback not called!\n");
// Check client registration callback after jack_client_new
jack_sleep(2000);
if (client_register == 0) {
printf("!!! ERROR !!! Client registration callback not called for an opened client !\n");
}
// Check client registration callback after jack_client_close
jack_client_close(client2);
jack_sleep(2000);
if (client_register == 1) {
printf("!!! ERROR !!! Client registration callback not called for a closed client!\n");
}
// Open client2 again...
client2 = jack_client_new(client_name2);
/**
* Register callback for this client.