summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Brand <tom@trellis.ch>2019-01-27 06:22:18 +0100
committerThomas Brand <tom@trellis.ch>2019-01-27 06:22:18 +0100
commit54e03c12af22745bbcc00ea0ebc4b2b2179d3388 (patch)
tree5966121cb7a9f0acd36a385a627d34b543352080
parent9753f7106918ee3178f6824a69d9d20ebc3c87ea (diff)
downloadjack2-54e03c12af22745bbcc00ea0ebc4b2b2179d3388.tar.gz
add another testcase for client name
-rw-r--r--tests/test.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/tests/test.cpp b/tests/test.cpp
index d01f5a84..cf02e209 100644
--- a/tests/test.cpp
+++ b/tests/test.cpp
@@ -750,8 +750,8 @@ int main (int argc, char *argv[])
char client_name3[jack_client_name_size()];
// "jack_client_name_size" - 1 effective characters
memset(client_name3, 'A', sizeof(client_name3));
- // set last expected printable to 'X'
- client_name3[jack_client_name_size()-2] = 'X';
+ // set last expected printable to '4'
+ client_name3[jack_client_name_size()-2] = '4';
// And last one is the terminating '0'
client_name3[jack_client_name_size()-1] = 0;
Log("trying to register a new jackd client with maximum possible client name size...\n", client_name3);
@@ -763,6 +763,27 @@ int main (int argc, char *argv[])
printf("!!! ERROR !!! opening a client with maximum possible client name size does not work!\n");
}
+ // test with one less:
+ // set last expected printable to '3'
+ client_name3[jack_client_name_size()-3] = '3';
+ // And (second) last one is the terminating '0'
+ client_name3[jack_client_name_size()-2] = 0;
+ Log("trying to register a new jackd client with maximum possible client name size -1...\n", client_name3);
+ client2 = jack_client_open(client_name3, jack_options, &status, server_name);
+ if (client2 != NULL) {
+ Log ("valid : a client with maximum possible client name size -1 can be opened\n");
+ Log("Testing long name...");
+ client_name2 = jack_get_client_name(client2);
+ if (strcmp(client_name2, client_name3) == 0) {
+ Log(" ok\n");
+ } else {
+ printf("\n!!! ERROR !!! name returned different from the one given : %s\n", client_name2);
+ }
+ jack_client_close(client2);
+ } else {
+ printf("!!! ERROR !!! opening a client with maximum possible client name size -1 does not work!\n");
+ }
+
/**
* testing client name...
* Verify that the name sended at registration and the one returned by jack server is the same...