summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStephane Letz <letz@grame.fr>2013-01-26 19:04:15 +0100
committerStephane Letz <letz@grame.fr>2013-01-26 19:04:15 +0100
commit76491d3bc5bad0bce873adbe828da27c07b0ed1c (patch)
treeda3f4564d17f2d1e5543d073b45900895621f12e /tests
parentc1f057e013c44c5bdc1530305660f85fe4b1b92b (diff)
downloadjack2-76491d3bc5bad0bce873adbe828da27c07b0ed1c.tar.gz
Add more tests for client registration code in test.cpp.
Diffstat (limited to 'tests')
-rw-r--r--tests/test.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/tests/test.cpp b/tests/test.cpp
index 9c0815db..750d152c 100644
--- a/tests/test.cpp
+++ b/tests/test.cpp
@@ -718,7 +718,6 @@ int main (int argc, char *argv[])
}
}
-
/**
* try to register another one with the same name...
*
@@ -970,7 +969,7 @@ int main (int argc, char *argv[])
}
/**
- * Test if portrename callback have been called.
+ * Test if port rename callback have been called.
*
*/
jack_port_set_name (output_port1, "renamed-port#");
@@ -980,13 +979,12 @@ int main (int argc, char *argv[])
printf("!!! ERROR !!! Jack_Port_Rename_Callback was not called !!.\n");
}
-
/**
- * Test if portregistration callback have been called.
+ * 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);
@@ -1319,6 +1317,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) {
@@ -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.
@@ -1398,8 +1409,8 @@ int main (int argc, char *argv[])
process2_activated = -1;
process1_activated = -1;
if (jack_activate(client2) < 0) {
- printf ("Fatal error : cannot activate client2\n");
- exit (1);
+ printf("Fatal error : cannot activate client2\n");
+ exit(1);
}
/**