Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
1227a332
Commit
1227a332
authored
13 years ago
by
Jonathan Guinet
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Baseline file extension checking mantis #ref 476 - JIRA OTB-120 SubTask
parent
227287aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Testing/otbTestHelper.cxx
+18
-9
18 additions, 9 deletions
Code/Testing/otbTestHelper.cxx
with
18 additions
and
9 deletions
Code/Testing/otbTestHelper.cxx
+
18
−
9
View file @
1227a332
...
...
@@ -1014,28 +1014,37 @@ std::map<std::string, int> TestHelper::RegressionTestBaselines(char *baselineFil
std
::
map
<
std
::
string
,
int
>
baselines
;
baselines
[
std
::
string
(
baselineFilename
)]
=
0
;
std
::
string
myPath
=
itksys
::
SystemTools
::
GetFilenamePath
(
baselineFilename
);
std
::
string
myPath
=
itksys
::
SystemTools
::
GetFilenamePath
(
baselineFilename
);
itksys
::
Directory
myDir
;
myDir
.
Load
(
myPath
.
c_str
()
);
myDir
.
Load
(
myPath
.
c_str
());
const
unsigned
int
nbFiles
=
myDir
.
GetNumberOfFiles
();
const
std
::
string
originalBaseline
=
itksys
::
SystemTools
::
GetFilenameWithoutLastExtension
(
baselineFilename
);
const
unsigned
int
sizeRef
=
originalBaseline
.
size
();
const
bool
HasExtension
=
sizeRef
!=
itksys
::
SystemTools
::
GetFilenameName
(
baselineFilename
).
size
();
myPath
.
append
(
"/"
);
itksys
::
RegularExpression
reg
;
reg
.
compile
(
"^
\\
.[0-9]"
);
reg
.
compile
(
"^
\\
.[0-9]"
);
for
(
unsigned
int
i
=
0
;
i
<
nbFiles
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
nbFiles
;
i
++
)
{
const
std
::
string
curFilename
=
itksys
::
SystemTools
::
GetFilenameWithoutLastExtension
(
myDir
.
GetFile
(
i
)
);
if
(
curFilename
.
substr
(
0
,
sizeRef
)
==
originalBaseline
)
std
::
string
curFilename
;
if
(
HasExtension
)
{
curFilename
=
itksys
::
SystemTools
::
GetFilenameWithoutLastExtension
(
myDir
.
GetFile
(
i
));
}
else
{
curFilename
=
itksys
::
SystemTools
::
GetFilenameName
(
myDir
.
GetFile
(
i
));
}
if
(
curFilename
.
substr
(
0
,
sizeRef
)
==
originalBaseline
)
{
if
(
reg
.
find
(
curFilename
.
substr
(
sizeRef
,
curFilename
.
size
())))
if
(
reg
.
find
(
curFilename
.
substr
(
sizeRef
,
curFilename
.
size
())))
{
std
::
string
myFile
=
myPath
;
baselines
[
myFile
.
append
(
myDir
.
GetFile
(
i
)
)]
=
0
;
baselines
[
myFile
.
append
(
myDir
.
GetFile
(
i
)
)]
=
0
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment