From f9b256044f8a645f294672c04d9ea9d95af78d6e Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Tue, 23 May 2017 14:27:50 +1000 Subject: Remove old jack_utils.h header that was moved to the JACK backend Also remove a related test that has not been part of the unit tests since the move (years). --- libs/ardour/test/jack_utils_test.cc | 290 ------------------------------------ libs/ardour/test/jack_utils_test.h | 31 ---- 2 files changed, 321 deletions(-) delete mode 100644 libs/ardour/test/jack_utils_test.cc delete mode 100644 libs/ardour/test/jack_utils_test.h (limited to 'libs/ardour/test') diff --git a/libs/ardour/test/jack_utils_test.cc b/libs/ardour/test/jack_utils_test.cc deleted file mode 100644 index d8a21ceb49..0000000000 --- a/libs/ardour/test/jack_utils_test.cc +++ /dev/null @@ -1,290 +0,0 @@ - -#include - -#ifdef PLATFORM_WINDOWS -#include // only for Sleep -#endif - -#include - -#include "ardour/jack_utils.h" - -#include "jack_utils_test.h" - -CPPUNIT_TEST_SUITE_REGISTRATION (JackUtilsTest); - -using namespace std; -using namespace ARDOUR; - -void -JackUtilsTest::test_driver_names () -{ - vector driver_names; - - get_jack_audio_driver_names (driver_names); - - CPPUNIT_ASSERT(!driver_names.empty()); - - cout << endl; - cout << "Number of possible JACK Audio drivers found on this system: " << driver_names.size () << endl; - - for (vector::const_iterator i = driver_names.begin(); i != driver_names.end(); ++i) { - cout << "JACK Audio driver found: " << *i << endl; - } - - string default_audio_driver; - get_jack_default_audio_driver_name (default_audio_driver); - - cout << "The default audio driver on this system is: " << default_audio_driver << endl; - - driver_names.clear(); - - get_jack_midi_system_names (default_audio_driver, driver_names); - - CPPUNIT_ASSERT(!driver_names.empty()); - - cout << "Number of possible JACK MIDI drivers found on this system for default audio driver: " << driver_names.size () << endl; - - for (vector::const_iterator i = driver_names.begin(); i != driver_names.end(); ++i) { - cout << "JACK MIDI driver found: " << *i << endl; - } - - string default_midi_driver; - get_jack_default_midi_system_name (default_audio_driver, default_midi_driver); - - cout << "The default midi driver on this system is: " << default_midi_driver << endl; -} - -string -devices_string (const vector& devices) -{ - std::string str; - for (vector::const_iterator i = devices.begin(); i != devices.end();) { - str += *i; - if (++i != devices.end()) str += ", "; - } - return str; -} - -void -JackUtilsTest::test_device_names () -{ - vector driver_names; - - get_jack_audio_driver_names (driver_names); - - CPPUNIT_ASSERT(!driver_names.empty()); - - cout << endl; - - for (vector::const_iterator i = driver_names.begin(); i != driver_names.end(); ++i) { - string devices = devices_string (get_jack_device_names_for_audio_driver (*i)); - cout << "JACK Audio driver found: " << *i << " with devices: " << devices << endl; - } -} - -void -JackUtilsTest::test_samplerates () -{ - vector samplerates; - - get_jack_sample_rate_strings (samplerates); - cout << endl; - cout << "Number of possible Samplerates supported by JACK: " << samplerates.size () << endl; - - for (vector::const_iterator i = samplerates.begin(); i != samplerates.end(); ++i) { - cout << "Samplerate: " << *i << endl; - } -} - -void -JackUtilsTest::test_period_sizes () -{ - vector period_sizes; - - get_jack_period_size_strings (period_sizes); - cout << endl; - cout << "Number of possible Period sizes supported by JACK: " << period_sizes.size () << endl; - - for (vector::const_iterator i = period_sizes.begin(); i != period_sizes.end(); ++i) { - cout << "Period size: " << *i << endl; - } -} - -void -JackUtilsTest::test_dither_modes () -{ - vector driver_names; - - get_jack_audio_driver_names (driver_names); - - CPPUNIT_ASSERT(!driver_names.empty()); - - cout << endl; - - for (vector::const_iterator i = driver_names.begin(); i != driver_names.end(); ++i) { - vector dither_modes; - - get_jack_dither_mode_strings (*i, dither_modes); - cout << "Number of possible Dither Modes supported by JACK driver " << *i << - ": " << dither_modes.size () << endl; - for (vector::const_iterator j = dither_modes.begin(); j != dither_modes.end(); ++j) { - cout << "Dither Mode: " << *j << endl; - } - cout << endl; - } - -} - -void -JackUtilsTest::test_connect_server () -{ - cout << endl; - if (jack_server_running ()) { - cout << "Jack server running " << endl; - } else { - cout << "Jack server not running " << endl; - } -} - -void -JackUtilsTest::test_set_jack_path_env () -{ - cout << endl; - - bool path_env_set = false; - - string path_env = Glib::getenv ("PATH", path_env_set); - - if (path_env_set) { - cout << "PATH env set to: " << path_env << endl; - } else { - cout << "PATH env not set" << endl; - } - vector server_dirs; - get_jack_server_dir_paths (server_dirs); - set_path_env_for_jack_autostart (server_dirs); - - path_env_set = false; - - path_env = Glib::getenv ("PATH", path_env_set); - - CPPUNIT_ASSERT (path_env_set); - - cout << "After set_jack_path_env PATH env set to: " << path_env << endl; -} - -void -JackUtilsTest::test_server_paths () -{ - cout << endl; - - vector server_dirs; - - CPPUNIT_ASSERT (get_jack_server_dir_paths (server_dirs)); - - cout << "Number of Directories that may contain JACK servers: " << server_dirs.size () << endl; - - for (vector::const_iterator i = server_dirs.begin(); i != server_dirs.end(); ++i) { - cout << "JACK server directory path: " << *i << endl; - } - - vector server_names; - - CPPUNIT_ASSERT (get_jack_server_application_names (server_names)); - - cout << "Number of possible JACK server names on this system: " << server_names.size () << endl; - - for (vector::const_iterator i = server_names.begin(); i != server_names.end(); ++i) { - cout << "JACK server name: " << *i << endl; - } - - vector server_paths; - - CPPUNIT_ASSERT (get_jack_server_paths (server_dirs, server_names, server_paths)); - - cout << "Number of JACK servers on this system: " << server_paths.size () << endl; - - for (vector::const_iterator i = server_paths.begin(); i != server_paths.end(); ++i) { - cout << "JACK server path: " << *i << endl; - } - - vector server_paths2; - - CPPUNIT_ASSERT (get_jack_server_paths (server_paths2)); - - CPPUNIT_ASSERT (server_paths.size () == server_paths2.size ()); - - std::string default_server_path; - - CPPUNIT_ASSERT (get_jack_default_server_path (default_server_path)); - - cout << "The default JACK server on this system: " << default_server_path << endl; -} - -bool -get_default_jack_command_line (std::string& command_line) -{ - cout << endl; - - JackCommandLineOptions options; - - CPPUNIT_ASSERT (get_jack_default_server_path (options.server_path)); - - get_jack_default_audio_driver_name (options.driver); - - - // should fail, haven't set any device yet - CPPUNIT_ASSERT (!get_jack_command_line_string (options, command_line)); - - vector devices = get_jack_device_names_for_audio_driver (options.driver); - - if (!devices.empty()) { - options.input_device = devices.front (); - options.output_device = devices.front (); - } else { - cout << "No audio devices available using default JACK driver using Dummy driver" << endl; - options.driver = dummy_driver_name; - devices = get_jack_device_names_for_audio_driver (options.driver); - CPPUNIT_ASSERT (!devices.empty ()); - options.input_device = devices.front (); - options.output_device = devices.front (); - } - - options.input_device = devices.front (); - options.output_device = devices.front (); - - string midi_driver; - - get_jack_default_midi_system_name (options.driver, options.midi_driver); - // - // this at least should create a valid jack command line - return get_jack_command_line_string (options, command_line); - -} - -void -JackUtilsTest::test_config () -{ - std::string config_path(get_jack_server_user_config_file_path()); - - cout << "Jack server config file path: " << config_path << endl; - - std::string command_line; - - CPPUNIT_ASSERT (get_default_jack_command_line (command_line)); - - CPPUNIT_ASSERT (write_jack_config_file (config_path, command_line)); -} - - -void -JackUtilsTest::test_command_line () -{ - string command_line; - - // this at least should create a valid jack command line - CPPUNIT_ASSERT (get_default_jack_command_line (command_line)); - - cout << "Default JACK command line: " << command_line << endl; -} diff --git a/libs/ardour/test/jack_utils_test.h b/libs/ardour/test/jack_utils_test.h deleted file mode 100644 index 08fad2fc36..0000000000 --- a/libs/ardour/test/jack_utils_test.h +++ /dev/null @@ -1,31 +0,0 @@ - -#include -#include - -class JackUtilsTest : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE (JackUtilsTest); - CPPUNIT_TEST (test_driver_names); - CPPUNIT_TEST (test_device_names); - CPPUNIT_TEST (test_samplerates); - CPPUNIT_TEST (test_period_sizes); - CPPUNIT_TEST (test_dither_modes); - CPPUNIT_TEST (test_connect_server); - CPPUNIT_TEST (test_set_jack_path_env); - CPPUNIT_TEST (test_server_paths); - CPPUNIT_TEST (test_config); - CPPUNIT_TEST (test_command_line); - CPPUNIT_TEST_SUITE_END (); - -public: - void test_driver_names (); - void test_device_names (); - void test_samplerates (); - void test_period_sizes (); - void test_dither_modes (); - void test_connect_server (); - void test_set_jack_path_env (); - void test_server_paths (); - void test_config (); - void test_command_line (); -}; -- cgit v1.2.3