Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
464491fb
Commit
464491fb
authored
8 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
Correct
4308c882
: one path decomposition was not yet converted
parent
67518eae
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/Functional/PyCore/persistence/PyPersistenceTest.cpp
+13
-13
13 additions, 13 deletions
Tests/Functional/PyCore/persistence/PyPersistenceTest.cpp
with
13 additions
and
13 deletions
Tests/Functional/PyCore/persistence/PyPersistenceTest.cpp
+
13
−
13
View file @
464491fb
...
@@ -103,39 +103,39 @@ void PyPersistenceTest::runTest()
...
@@ -103,39 +103,39 @@ void PyPersistenceTest::runTest()
}
}
//! Returns true if test output and reference file agree.
//! Returns true if test output and reference file agree.
bool
PyPersistenceTest
::
compareFilePair
(
const
std
::
string
&
dat_f
name
,
const
std
::
string
&
ref_f
name
)
bool
PyPersistenceTest
::
compareFilePair
(
const
std
::
string
&
dat_f
path
,
const
std
::
string
&
ref_f
path
)
{
{
std
::
cout
<<
"Comparing dat='"
<<
dat_f
name
<<
"' with ref='"
<<
ref_f
name
<<
"':
\n
"
;
std
::
cout
<<
"Comparing dat='"
<<
dat_f
path
<<
"' with ref='"
<<
ref_f
path
<<
"':
\n
"
;
const
std
::
string
extension
=
Utils
::
String
::
split
(
dat_fname
,
"."
)[
2
];
const
std
::
string
extension
=
Utils
::
String
::
split
(
FileSystem
::
filename
(
dat_fpath
)
,
"."
)[
2
];
if
(
extension
==
"int"
)
if
(
extension
==
"int"
)
return
compareIntensityPair
(
dat_f
name
,
ref_f
name
);
return
compareIntensityPair
(
dat_f
path
,
ref_f
path
);
if
(
extension
==
"yaml"
)
if
(
extension
==
"yaml"
)
return
compareYamlPair
(
dat_f
name
,
ref_f
name
);
return
compareYamlPair
(
dat_f
path
,
ref_f
path
);
std
::
cerr
<<
"Failed: Unsupported file type '"
<<
extension
<<
"'.
\n
"
;
std
::
cerr
<<
"Failed: Unsupported file type '"
<<
extension
<<
"'.
\n
"
;
return
false
;
return
false
;
}
}
//! Returns true if intensity maps from test output and reference file agree reasonably.
//! Returns true if intensity maps from test output and reference file agree reasonably.
bool
PyPersistenceTest
::
compareIntensityPair
(
bool
PyPersistenceTest
::
compareIntensityPair
(
const
std
::
string
&
dat_f
name
,
const
std
::
string
&
ref_f
name
)
const
std
::
string
&
dat_f
path
,
const
std
::
string
&
ref_f
path
)
{
{
const
OutputData
<
double
>*
dat
=
IntensityDataIOFactory
::
readOutputData
(
dat_f
name
);
const
OutputData
<
double
>*
dat
=
IntensityDataIOFactory
::
readOutputData
(
dat_f
path
);
const
OutputData
<
double
>*
ref
=
IntensityDataIOFactory
::
readOutputData
(
ref_f
name
);
const
OutputData
<
double
>*
ref
=
IntensityDataIOFactory
::
readOutputData
(
ref_f
path
);
return
compareIntensityMaps
(
*
dat
,
*
ref
)
==
SUCCESS
;
return
compareIntensityMaps
(
*
dat
,
*
ref
)
==
SUCCESS
;
}
}
//! Returns true if YAML files from test output and reference agree.
//! Returns true if YAML files from test output and reference agree.
bool
PyPersistenceTest
::
compareYamlPair
(
const
std
::
string
&
dat_f
name
,
const
std
::
string
&
ref_f
name
)
bool
PyPersistenceTest
::
compareYamlPair
(
const
std
::
string
&
dat_f
path
,
const
std
::
string
&
ref_f
path
)
{
{
std
::
fstream
fdat
(
dat_f
name
);
std
::
fstream
fdat
(
dat_f
path
);
std
::
fstream
fref
(
ref_f
name
);
std
::
fstream
fref
(
ref_f
path
);
for
(
size_t
i
=
1
;
;
++
i
)
{
for
(
size_t
i
=
1
;
;
++
i
)
{
std
::
string
datline
;
std
::
string
datline
;
std
::
string
refline
;
std
::
string
refline
;
std
::
getline
(
fdat
,
datline
);
std
::
getline
(
fdat
,
datline
);
std
::
getline
(
fref
,
refline
);
std
::
getline
(
fref
,
refline
);
if
(
datline
!=
refline
)
{
if
(
datline
!=
refline
)
{
std
::
cerr
<<
"Line "
<<
i
<<
" of "
<<
dat_f
name
<<
" and "
<<
ref_f
name
std
::
cerr
<<
"Line "
<<
i
<<
" of "
<<
dat_f
path
<<
" and "
<<
ref_f
path
<<
" differs:
\n
"
;
<<
" differs:
\n
"
;
std
::
cerr
<<
"dat: '"
<<
datline
<<
"'
\n
"
;
std
::
cerr
<<
"dat: '"
<<
datline
<<
"'
\n
"
;
std
::
cerr
<<
"ref: '"
<<
refline
<<
"'
\n
"
;
std
::
cerr
<<
"ref: '"
<<
refline
<<
"'
\n
"
;
...
@@ -144,7 +144,7 @@ bool PyPersistenceTest::compareYamlPair(const std::string& dat_fname, const std:
...
@@ -144,7 +144,7 @@ bool PyPersistenceTest::compareYamlPair(const std::string& dat_fname, const std:
if
(
fdat
.
eof
()
&&
fref
.
eof
())
if
(
fdat
.
eof
()
&&
fref
.
eof
())
break
;
break
;
if
(
fdat
.
eof
()
||
fref
.
eof
())
{
if
(
fdat
.
eof
()
||
fref
.
eof
())
{
std
::
cerr
<<
"File length of "
<<
dat_f
name
<<
" and "
<<
ref_f
name
<<
" differs.
\n
"
;
std
::
cerr
<<
"File length of "
<<
dat_f
path
<<
" and "
<<
ref_f
path
<<
" differs.
\n
"
;
return
false
;
return
false
;
}
}
}
}
...
...
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