[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

dirent_uri-test failure on Windows ...?

From: Martin Hauner <martin.hauner_at_gmx.net>
Date: Sun, 25 Oct 2009 11:33:50 +0100

Hi,

I get a test failure with my mingw build in dirent_uri-test:
test_dirent_get_absolute.

After stepping into the code to find the problem, which is a drive letter case
mismatch again, I thought this should fail with a visual studio build too (vs
2008 express). And indeed it does.

The reason seems to be that "everyone" thinks the drive letters should be upper
case (there are various comments in svn and apr that the letter must be upper
case) but GetFullPathNameW returns a path with a lower case drive letter.

That's just an observation. I never cared about lower or upper case drive
letters before. So I have no idea why this is so and what is right ;-))

The issue is inside apr but I wonder if anyone else is getting this?

I'm not sure if anyone can follow this, but here is what's happening inside the
test and apr:

Test Case: dirent_uri-test.c (test_dirent_get_absolute, Line 2220)

{ "C:abc", "@/abc" },

expect_abs: 0x3dda98 "C:/Development/mingw/svn-trunk/subversion/tests/cmdline/abc"

svn_dirent_get_absolute
apr_filepath_merge (file_io/win32/filepath.c, apr 1.3)
   Line 362
   apr_filepath_root => addroot = "C:", addtype = APR_EINCOMPLETE
   Line 424
   filepath_drive_get => lowercase drive letter (GetFullPathNameW)
   Line 437
   apr_filepath_root => baseroot = "c:/", basetype = APR_EABSOLUTE
   Line 537
   else if (addroot[0] && addroot[1] == ':' && !addroot[2])
   Line 543
   if (addroot[0] == baseroot[0] && baseroot[1] == ':') {

here it fails because the case does not match!

and svn reports an
   SVN_ERR_BAD_FILENAME, "Couldn't determine absolute path of 'C:abc'"

If I change the case in gdb by hand the tests succeeds.

-- 
Martin
Subcommander 2.0.0 Beta 5 - http://subcommander.tigris.org
a Win32/Unix/MacOSX subversion GUI client & diff/merge tool.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2411150
Received on 2009-10-25 11:34:11 CET

This is an archived mail posted to the Subversion Dev mailing list.