Opened 18 years ago
Closed 15 years ago
#243 closed defect (fixed)
common/fileutils.cc needs tests
| Reported by: | Richard Boulton | Owned by: | Olly Betts |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2.3 |
| Component: | Test Suite | Version: | SVN trunk |
| Severity: | normal | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Operating System: | All |
Description (last modified by )
This file was added for use by the replication stuff, and handles parsing and some simple manipulation of paths. This is particularly tricky for windows paths, unfortunately, and needs proper testing.
Change History (11)
comment:1 by , 18 years ago
| Blocking: | 160 added |
|---|---|
| Owner: | changed from to |
comment:2 by , 18 years ago
| Operating System: | → All |
|---|---|
| Status: | new → assigned |
comment:4 by , 18 years ago
| Description: | modified (diff) |
|---|---|
| Milestone: | → 1.1 |
comment:5 by , 18 years ago
| Blocking: | 160 removed |
|---|
comment:6 by , 17 years ago
| Milestone: | 1.1.0 → 1.1.1 |
|---|
comment:9 by , 15 years ago
| Milestone: | 1.2.x → 1.2.3 |
|---|---|
| Owner: | changed from to |
| Status: | assigned → new |
Working on this,
comment:10 by , 15 years ago
| Status: | new → assigned |
|---|
As of r14838, there are now testcases in fileutils.cc. These aren't currently run (but you can build a little test program with:
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):
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).
comment:12 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Created new unittest program in r14842 which runs these tests.

Tests are good, but this isn't worth holding up 1.1.0 for.