The src/test/test_util.c doesn't compile with MSVC (CL ver. 16.00.30319.01). It doesn't like the "#ifdef 0" construct, but the whole chunk should be enabled with some modifications IMHO.
'path_is_relative()' doesn't handle the "http:\dir" case though. Why should it? Besides 'expand_filename()' isn't for Windows. I suggest this patch:
--- Git-latest\src\test\test_util.c Fri Apr 06 22:45:14 2012 +++ src\test\test_util.c Thu Apr 26 08:59:18 2012 @@ -1526,10 +1526,6 @@
/* Windows */ #ifdef MS_WINDOWS - /* I don't have Windows so I can't test this, hence the "#ifdef - 0". These are tests that look useful, so please try to get them - running and uncomment if it all works as it should */ -#ifdef 0 test_eq(1, path_is_relative("dir")); test_eq(1, path_is_relative("dir\")); test_eq(1, path_is_relative("dir\a:")); @@ -1538,8 +1534,7 @@ test_eq(0, path_is_relative("\dir")); test_eq(0, path_is_relative("a:\dir")); test_eq(0, path_is_relative("z:\dir")); - test_eq(0, path_is_relative("http:\dir")); -#endif + test_eq(1, path_is_relative("http:\dir")); /* path_is_relative() doesn't test for such */
#endif
done: @@ -2887,7 +2882,9 @@ UTIL_LEGACY(config_line_quotes), UTIL_LEGACY(config_line_comment_character), UTIL_LEGACY(config_line_escaped_content), +#ifndef MS_WINDOWS UTIL_LEGACY(expand_filename), +#endif UTIL_LEGACY(strmisc), UTIL_LEGACY(pow2), UTIL_LEGACY(gzip),
With the above, test/test.exe now says: util/path_is_relative: OK
--gv
On Thu, 26 Apr 2012 09:09:09 +0200, Gisle Vanem gvanem@broadpark.no wrote:
The src/test/test_util.c doesn't compile with MSVC (CL ver. 16.00.30319.01). It doesn't like the "#ifdef 0" construct, but the whole chunk should be enabled with some modifications IMHO.
Ugh, sorry about that. I made the changes blindly because I didn't have any way to test them on Windows :-S
'path_is_relative()' doesn't handle the "http:\dir" case though. Why should it? Besides 'expand_filename()' isn't for Windows. I suggest this patch:
Looking at the tests now, if we leave "http:\dir" around it should probably return 1 (it's as nonsensical as "dir\a:" so it should behave the same). It's probably not useful, so we can drop it... but in case of leaving it around, it should be moved right after "dir\a:\" (ie. at the end of the cases that return 1).
On Thu, Apr 26, 2012 at 4:37 PM, Esteban Manchado Velázquez emanchado@demiurgo.org wrote:
On Thu, 26 Apr 2012 09:09:09 +0200, Gisle Vanem gvanem@broadpark.no wrote:
The src/test/test_util.c doesn't compile with MSVC (CL ver. 16.00.30319.01). It doesn't like the "#ifdef 0" construct, but the whole chunk should be enabled with some modifications IMHO.
Ugh, sorry about that. I made the changes blindly because I didn't have any way to test them on Windows :-S
'path_is_relative()' doesn't handle the "http:\dir" case though. Why should it? Besides 'expand_filename()' isn't for Windows. I suggest this patch:
Looking at the tests now, if we leave "http:\dir" around it should probably return 1 (it's as nonsensical as "dir\a:" so it should behave the same). It's probably not useful, so we can drop it... but in case of leaving it around, it should be moved right after "dir\a:\" (ie. at the end of the cases that return 1).
Thanks! I actually ran into the same issues today while I was experimenting with cross-compiling from fedora 16. I checked in this fix, and some unrelated cross-compilation issues, as 9dddfe83f3041e1504d2def5.
yrs,