summaryrefslogtreecommitdiff
path: root/libs/pbd/test
AgeCommit message (Collapse)Author
2017-04-19Use XMLNode::set_property API in xml testsTim Mayberry
2017-04-19Make boolean string values 0 and 1 to maintain backwards compatibilityTim Mayberry
I would prefer "yes" and "no" as it distinguishes boolean values from numeric but using "yes and "no" results in PBD::Property<T>::from_string failing to parse the correct values when opening in an older Ardour version as there is no specialization for bool. Using 0 and 1 also results in less change to the Session file.
2017-04-17Fix string-convert tests for Windows and hopefully macOS/OS XTim Mayberry
Tests requires a locale installed on the host that uses a comma as the decimal mark/point.
2017-04-16Add locale independent and thread safe string conversion API with testsTim Mayberry
All conversions are performed as if in the "C" locale but without actually changing locale. This is a wrapper around printf/sscanf for int types which aren't affected by locale and uses glib functions g_ascii_strtod and g_ascii_dtostr for float/double types. My first attempt at this used std::stringstream and ios::imbue(std::locale::classic()) as it should be thread safe, but testing shows it is not for gcc/mingw-w64 on Windows, and possibly also some versions of macOS/OS X. Use "yes" and "no" when converting a boolean in PBD::string_to<bool> as this seems to be the convention used throughout libardour which will allow using string_to<bool> in those cases. Add accepted bool string values from PBD::string_is_affirmative to PBD::string_to<bool> Mark strings in pbd/string_convert.cc as not for translation Add u/int16_t string conversions to pbd/string_convert.h and tests Add DEBUG_TRACE output on conversion errors Add int8_t/uint8_t conversions(using int16/uint16 types) to string_convert.h Add support for converting an infinity expression to/from string Follows the C99/C11 standard for strtof/strtod where subject sequence is an optional plus or minus sign then INF or INFINITY, ignoring case.
2016-10-10Add test of pbd/xml++.h API performance with three file sizesTim Mayberry
Generate, write and then read three Session like XML files to test the performance of changes made to pbd/xml++.h API
2016-09-19PBD::canonical_path will no longer throw so change testTim Mayberry
2016-09-19Add test for PBD::canonical_path on Windows using utf8 stringsTim Mayberry
This currently fails because the windows only realpath implementation in pbd/pathexpand.cc, which is called from PBD::canonical_path to resolve the path uses Glib::locale_from/to_utf8. As I demonstrated in the testOpenFileUTF8Filename test case Glib::locale_from/to_utf8 are not the correct functions to use for this use case as it converts to/from utf-8 to the locale's current character encoding. On Windows this is most often a single byte encoding such as Windows-1252 and conversion will fail if the path contains any characters that are not in system codepage.
2016-09-19Give the Windows MMTimer test a better chance of passingTim Mayberry
The default scheduling on windows seems fairly erratic or is at least in the VM that I'm running these tests on, so increase the timing slack a bit so the test has a better chance of passing. It is still quite easy for it to fail though, especially if you for instance manipulate the terminal window somehow while running the tests but it does not really matter in any case as this test serves its purpose in testing the PBD::MMTimers API.
2016-07-14add a natural sort algorithmRobin Gareus
2016-02-23missing include for rand() in self-testsRobin Gareus
2016-02-22realloc-pool unit-testRobin Gareus
2015-10-05use quotes for in-tree pbd/glib wrapper includeRobin Gareus
2015-10-05NOOP, remove trailing tabs/whitespace.Robin Gareus
2015-10-04globally remove all trailing whitespace from ardour code base.Paul Davis
Paul Davis was responsible for introducing almost all of this.
2015-09-27update semantics of PBD::remove_directory()Robin Gareus
Remove the directory recursively including itself. The function is used in two places only: * LV2Plugin::add_state() -- no change, remove tmp. state * Session::save_as() -- on error, remove target In both cases removing the folder itself is correct.
2015-09-19Fix windows test to also pass under wineTim Mayberry
It looks as if the default timer resolution for applications running under wine is different than Windows so just test that the minimum timer resolution is below a certain amount rather than checking before and after calling timeBeginPeriod
2015-09-17Add test to libpbd to check PBD::touch_file and pbd/gstdio_compat.hTim Mayberry
GStatBuf is not usable on 32 bit Windows without the redefinition in pbd/gstdio_compat.h so add a test to check for the correct behavior of g_stat and g_utime on all platforms now that the issue is fixed.
2015-09-17use pbd's gstdio compatibility wrapperRobin Gareus
2015-09-16Rename PBD::QPC::get_timer_valid to check_timer_valid and perform timer testTim Mayberry
I'm not sure if this test is going to be effective as I don't have hardware to test on at the moment. As noted in the documentation, Windows XP should be the only OS where QPC uses a timer source that is non-monotonic(multi-core with non-syncronized TSC).
2015-09-16Add windows specific test for pbd/windows_timer_utils.h APITim Mayberry
2015-09-13allow to run unit-test under wine from srcdir.Robin Gareus
2015-07-25Add unit test to check that libxml2 expects utf-8 encoded file paths on WindowsTim Mayberry
2015-07-25Only create one test output directory in file copy testTim Mayberry
Rather than one directory for each file
2015-07-25Add unit test to assert that using locale_from_utf8/::open will fail for ↵Tim Mayberry
some file paths on Windows
2015-03-08Reduce run time/output of PBD::Timer unit testTim Mayberry
2015-02-14fix testPathIsWithin unit-test:Robin Gareus
* use absolute path * fix copy/paste typo: bar->jim for symlink test
2015-02-12Add local PwdReset class to reset pwd in event of test failureTim Mayberry
This fixes subsequent tests that rely on pwd but not PBD::path_is_within breakage caused by commit 2689848e
2015-02-12Add some more test assertions so that tests fail when they shouldTim Mayberry
2015-01-01Add tests that show the timing differences between the Glib/mm based timeoutsTim Mayberry
This shows that PBD::Timer is pretty much identical in terms of timing and CPU usage as Glib TimeoutSources. They also show the differences on Windows when setting the minimum Multimedia Timer resolution using timeBeginPeriod
2014-12-03Fix running libpbd unit tests when $TOP(in test scripts) is set as relative pathTim Mayberry
Add test for PBD::canonical_path that was used to track down silly mistake in test code
2014-12-03Use test_output_directory() in pbd filesystem testTim Mayberry
This prevents directory being created in pwd and means deletion of directory is unnecessary
2014-12-03Use PBD::tmp_writable_directory in test_output_directoryTim Mayberry
2014-06-25Add unit tests for PBD::clear_directory and PBD::remove_directoryTim Mayberry
2014-06-25Rename internal class to stop the wrong destructor from being calledTim Mayberry
2014-06-25Add a PBD::TextReceiver in pbd testrunnerTim Mayberry
2014-06-25Add simple test for PBD::find_files_matching_patternTim Mayberry
This helped fix a silly cut and paste error in pbd/file_utils.cc so might as well included it.
2014-06-25Add test utility function to PBD tests to return some utf-8 stringsTim Mayberry
This is currently unused
2014-06-25Add a test for PBD::copy_file using test files with utf-8 encoded filenamesTim Mayberry
2014-06-25Call PBD::init and PBD::cleanup in pbd test executableTim Mayberry
2014-06-25Add test for PBD::copy_fileTim Mayberry
From this I can see that PBD::copy_file is not working correctly on windows as it is adding windows style line endings. Adding O_BINARY to ::open flags would fix it, but perhaps there is a better way...
2014-06-25Add utility function to test lib to create a test directoryTim Mayberry
There is an identical function in libardour test support lib so we should probably find a better place to put this at some point
2014-06-25Rename PBD::find_file_in_search_path to just PBD::find_fileTim Mayberry
saves a bit of typing and not necessary if you look at how it is used.
2013-09-06Rename SearchPath class SearchpathTim Mayberry
Windows headers define SearchPath which means we have to undefine it where necessary. This is a pain and can be tricksy, so I feel renaming the class slightly is the easiest solution.
2013-07-17Merge branch 'windows' of git://git.ardour.org/ardour/ardour into windowsJohn Emmas
2013-07-17Remaining changes needed for building libpdb on Windows (except for adding ↵John Emmas
the extra JE source modules)
2013-07-15add and Update mutex test that is no longer necessary now that glib has been ↵Paul Davis
fixed
2013-07-13Add test for Glib::Mutex::trylockPaul Davis
Behaviour of this method is different on WIN32
2013-07-11Ifdef unix specific test for mingw buildPaul Davis
2013-07-11add new files from test changes by timbyrPaul Davis
2013-07-11Use test_search_path to find test data in xpath testPaul Davis