cxxtest: DirUtil UnitTest fails in Windows

Bug #1409208 reported by Mark Harmer on 2015-01-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Unassigned

Bug Description

Running the DirUtilTests under Windows produces the following failures:

./src/dir-util-test.h:29: Error: Expected (result == std::string(cases[i][2])), found ("/foo/bar" != "bar")
./src/dir-util-test.h:29: Error: Expected (result == std::string(cases[i][2])), found ("/foo/bar/baz" != "bar/baz")
./src/dir-util-test.h:29: Error: Expected (result == std::string(cases[i][2])), found ("/foo/bar/baz" != "foo/bar/baz")

This appears to be a result of assumptions made on the path separators.

I've attached a patch that resolves this failure under Windows.

Reproduce Steps:
1. Run 'btool check' on the source checked out in Windows
2. This builds and runs the full CxxTest unittests, observe 10 test failures at the end. With the supplied patch this should drop to 9.

I wasn't able to specify the individual test directly with the cxxtests executable created so the output will be polluted with other tests that are failing.

Mark Harmer (drivehappy) wrote :
Alvin Penner (apenner) wrote :

HI,
    could you indicate how to run this test? Is it a Python file? Is it in the folder:
C:\Program Files\Inkscape\share\extensions\test> ?

Mark Harmer (drivehappy) on 2015-01-10
description: updated
Mark Harmer (drivehappy) wrote :

Hi Alvin,

I've updated the description to include reproduce steps. This isn't part of the extensions, but I was simply running the btool to generate and run the CxxTests from the source.

Alvin Penner (apenner) wrote :

thanks for the info, bug confirmed on

Windows XP, Inkscape 0.91+devel r13789 (Dec 6 2014)

the relevant output is:

In DirUtilTest::testBase:
./src/dir-util-test.h:29: Error: Expected (result == std::string(cases[i][2])), found ("/foo/bar" != "bar")
./src/dir-util-test.h:29: Error: Expected (result == std::string(cases[i][2])), found ("/foo/bar/baz" != "bar/baz")
./src/dir-util-test.h:29: Error: Expected (result == std::string(cases[i][2])), found ("/foo/bar/baz" != "foo/bar/baz")
.....Took 0.109 seconds to construct the test document

Changed in inkscape:
status: New → Confirmed
su_v (suv-lp) on 2015-01-10
tags: added: build win32 win64
summary: - DirUtil UnitTest fails in Windows
+ cxxtest: DirUtil UnitTest fails in Windows
Changed in inkscape:
importance: Undecided → Medium
Alvin Penner (apenner) wrote :

thanks for the patch, Mark!

tested and committed to rev 13887

Changed in inkscape:
status: Confirmed → Fix Committed
su_v (suv-lp) on 2015-05-04
Changed in inkscape:
milestone: none → 0.92
Bryce Harrington (bryce) on 2017-01-10
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers