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.
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.
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.
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
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.
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).
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
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...
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.