Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
2b2eb97e
Commit
2b2eb97e
authored
9 years ago
by
Markus Frank
Browse files
Options
Downloads
Patches
Plain Diff
Remove CppCheck warnings
parent
619c42e4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
DDTest/src/test_surface.cc
+1
-26
1 addition, 26 deletions
DDTest/src/test_surface.cc
DDTest/src/test_units.cc
+1
-23
1 addition, 23 deletions
DDTest/src/test_units.cc
with
2 additions
and
49 deletions
DDTest/src/test_surface.cc
+
1
−
26
View file @
2b2eb97e
...
...
@@ -6,11 +6,10 @@
#include
"DD4hep/Detector.h"
#include
"DDRec/Surface.h"
//
#include "
DDSurfaces/ISurface
.h"
#include
"
STR
.h"
#include
<exception>
#include
<iostream>
#include
<sstream>
#include
<assert.h>
#include
<cmath>
...
...
@@ -23,30 +22,6 @@ using namespace DDSurfaces ;
// this should be the first line in your test
DDTest
test
=
DDTest
(
"surface"
)
;
//=============================================================================
/** Helper class for floating point comparisons using string representations */
class
STR
{
STR
()
{}
float
_val
;
std
::
string
_str
;
public
:
STR
(
float
val
)
:
_val
(
val
),
_str
()
{
std
::
stringstream
s1
;
s1
<<
_val
;
_str
=
s1
.
str
()
;
}
std
::
string
str
()
const
{
return
_str
;
}
bool
operator
==
(
const
STR
&
s2
)
const
{
return
this
->
str
()
==
s2
.
str
()
;
}
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
STR
&
s
)
{
os
<<
s
.
str
()
;
return
os
;
}
//=============================================================================
int
main
(
int
argc
,
char
**
argv
){
...
...
This diff is collapsed.
Click to expand it.
DDTest/src/test_units.cc
+
1
−
23
View file @
2b2eb97e
...
...
@@ -2,10 +2,10 @@
#include
"DD4hep/LCDD.h"
#include
"DD4hep/DD4hepUnits.h"
#include
"STR.h"
#include
<exception>
#include
<iostream>
#include
<sstream>
#include
<assert.h>
#include
<cmath>
...
...
@@ -18,28 +18,6 @@ using namespace dd4hep ;
DDTest
test
=
DDTest
(
"units"
)
;
//=============================================================================
/** Helper class for floating point comparisons using string representations */
class
STR
{
STR
()
{}
float
_val
;
std
::
string
_str
;
public
:
STR
(
float
val
)
:
_val
(
val
),
_str
()
{
std
::
stringstream
s1
;
s1
<<
_val
;
_str
=
s1
.
str
()
;
}
std
::
string
str
()
const
{
return
_str
;
}
bool
operator
==
(
const
STR
&
s2
)
const
{
return
this
->
str
()
==
s2
.
str
()
;
}
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
STR
&
s
)
{
os
<<
s
.
str
()
;
return
os
;
}
//=============================================================================
int
main
(
int
argc
,
char
**
argv
){
...
...
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