[Xapian-tickets] [Xapian] #243: common/fileutils.cc needs tests
Xapian
nobody at xapian.org
Sat Jul 10 16:25:53 BST 2010
#243: common/fileutils.cc needs tests
------------------------+---------------------------------------------------
Reporter: richard | Owner: olly
Type: defect | Status: assigned
Priority: normal | Milestone: 1.2.3
Component: Test Suite | Version: SVN trunk
Severity: normal | Resolution:
Keywords: | Blockedby:
Platform: All | Blocking:
------------------------+---------------------------------------------------
Changes (by olly):
* status: new => assigned
Comment:
As of r14838, there are now testcases in fileutils.cc. These aren't
currently run (but you can build a little test program with:
{{{
#!sh
g++ -DXAPIAN_UNIT_TEST -Icommon -I. -W -Wall -O2 -o test-fileutils
common/fileutils.cc
}}}
It's also possible to define {{{__WIN32__}}} to run those tests on Linux
(and they pass too):
{{{
#!sh
g++ -DXAPIAN_UNIT_TEST -D__WIN32__ -Icommon -I. -W -Wall -O2 -o test-
fileutils common/fileutils.cc
}}}
I'm going to try to hook this up to the testsuite harness nicely next.
Adding these tests uncovered a few failures in the old routines which the
new function fixes. The is (sadly) one case which you can't resolve
reliably without knowing the current drive. Not sure if we care enough to
be looking that up - the case is stub file {{{/abs/o/lute}}} referring to
a database {{{C:rel/a/tive}}} which is either {{{C:/abs/o/rel/a/tive}}}
(if C: is the current drive) or {{{C:rel/a/tive}}} (otherwise).
There's also no special handling for UNC paths (there wasn't before
either) - {{{\\SERVER\VOLUME}}} should ideally be handled much like
{{{C:}}} (at least you can't have a UNC path which is relative!) I'll
commit a commented-out testcase which shows a problem with UNC paths in a
moment (probably r14839).
--
Ticket URL: <http://trac.xapian.org/ticket/243#comment:10>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list