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

[PATCH] Random testing of is_canonical(canonicalize(path))

From: Julian Foad <julianfoad_at_apache.org>
Date: Thu, 13 Dec 2018 17:14:41 +0000

This patch doesn't say anything about whether we wanted or now want the design of *_is_canonical() and *_canonicalize() to be such that is_canonical(canonicalize(path)) is always true. I present this for interested parties to play with and make progress.

Sample outputs:
[[[
DBG: dirent_uri-test.c:1191: non-c. dirent: 'O:.' -> 'O:.'
DBG: dirent_uri-test.c:1191: non-c. dirent: './v:' -> 'v:'
DBG: dirent_uri-test.c:1198: non-c. URI: 'u9' -> 'u9'
...
DBG: dirent_uri-test.c:1180: f='/hxDC7/'
lt-dirent_uri-test: /home/julianfoad/src/subversion-fsrepli/subversion/libsvn_subr/dirent_uri.c:322: canonicalize: Assertion `*src != '/'' failed.
]]]

To get the dirent failures I forcibly defined SVN_USE_DOS_PATHS in libsvn_subr/dirent_uri.c.

For whatever invariants we do decide should hold, it would be beneficial to have such a test in place.

The relpath_* functions do currently seem to obey this invariant, so I suggest we commit at least the relpath part of this, if we agree that's intended behaviour.

-- 
- Julian

Received on 2018-12-13 18:14:49 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.