You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling sdf::findFile with test_model/model.sdf as the input _filename, instead of a base file name (e.g. model.sdf), it does not throw any exceptions and returns the full path /path/to/test_model/model.sdf.
Actual behavior:
In Windows machines however, we will produce a path like so C:/somewhere\\path\\to\\models\\test_model/model.sdf, due to the lack of path sanitization.
17: [ RUN ] ElementTracing.includes
17: C:\Jenkins\workspace\sdformat-ci-pr_any-windows7-amd64\ws\sdformat\test\integration\element_tracing.cc(283): error: Expected equality of these values:
17: modelFilePath
17: Which is: "C:/Jenkins/workspace/sdformat-ci-pr_any-windows7-amd64/ws/sdformat\\test\\integration\\model\\test_model\\model.sdf"
17: overrideModelWithFileElem->FilePath()
17: Which is: "C:/Jenkins/workspace/sdformat-ci-pr_any-windows7-amd64/ws/sdformat\\test\\integration\\model\\test_model/model.sdf"
17: [ FAILED ] ElementTracing.includes (201 ms)
The text was updated successfully, but these errors were encountered:
I will make the changes to the issue accordingly, sorry for the confusion.
aaronchongth
changed the title
TestFile and SourceFile in test_config.hh appends paths without sanitization
sdf::findFile does not sanitize input filename, when given a path instead of a file name.
May 21, 2021
Environment
sdf11
Description
When calling
sdf::findFile
withtest_model/model.sdf
as the input_filename
, instead of a base file name (e.g.model.sdf
), it does not throw any exceptions and returns the full path/path/to/test_model/model.sdf
.In Windows machines however, we will produce a path like so
C:/somewhere\\path\\to\\models\\test_model/model.sdf
, due to the lack of path sanitization.Output
This was how it looked like during the Windows CI build for the lines https://github.com/osrf/sdformat/blob/sdf11/test/sdf/includes.sdf#L17-L20,
The text was updated successfully, but these errors were encountered: