diff options
author | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2008-12-16 09:16:02 +0000 |
---|---|---|
committer | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2008-12-16 09:16:02 +0000 |
commit | 171a3c4a0ddd18d2afae56f3af6291c8e96ee3ac (patch) | |
tree | f48685ac8646b570f6538b37a222acd9343ad3ec /tests | |
parent | 147726993bde308c37526ca62c3ab7f64cd5da7b (diff) | |
download | jack2-171a3c4a0ddd18d2afae56f3af6291c8e96ee3ac.tar.gz |
Client and library global context cleanup in case of incorrect shutdown handling (that is applications not correctly closing client after server has shutdown).
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3207 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'tests')
-rw-r--r-- | tests/external_metro.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/external_metro.cpp b/tests/external_metro.cpp index d073299b..50dba1f0 100644 --- a/tests/external_metro.cpp +++ b/tests/external_metro.cpp @@ -75,7 +75,7 @@ ExternalMetro::ExternalMetro(int freq, double max_amp, int dur_arg, int bpm, cha } if ((client = jack_client_open (client_name, options, &status)) == 0) { fprintf (stderr, "jack server not running?\n"); - return; + throw -1; } jack_set_process_callback (client, process_audio, this); @@ -184,6 +184,21 @@ int main (int argc, char *argv[]) printf("Opening a new client....\n"); client1 = new ExternalMetro(1200, 0.4, 20, 80, "t1"); + + printf("Now quit the server, shutdown callback should be called...\n"); + printf("Type 'c' to move on...\n"); + while ((getchar() != 'c')) { + JackSleep(1); + }; + + printf("Simulating client not correctly closed...\n"); + + printf("Opening a new client....\n"); + try { + client1 = new ExternalMetro(1200, 0.4, 20, 80, "t1"); + } catch (int num) { + printf("Cannot open a new client since old one was not closed correctly... OK\n"); + } printf("Type 'q' to quit...\n"); while ((getchar() != 'q')) { |