Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
GeoModelDev
GeoModel
Commits
857e4554
Commit
857e4554
authored
4 weeks ago
by
Shaun Roe
Committed by
Vakhtang Tsulaia
4 weeks ago
Browse files
Options
Downloads
Patches
Plain Diff
add test for CellBinning
parent
a7979e68
No related branches found
No related tags found
1 merge request
!450
add test for CellBinning
Pipeline
#12071596
passed
4 weeks ago
Stage: step-A
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GeoModelCore/GeoModelKernel/GeoModelKernel/RCBase.h
+1
-1
1 addition, 1 deletion
GeoModelCore/GeoModelKernel/GeoModelKernel/RCBase.h
GeoModelCore/GeoModelKernel/tests/testCellBinning.cxx
+72
-0
72 additions, 0 deletions
GeoModelCore/GeoModelKernel/tests/testCellBinning.cxx
with
73 additions
and
1 deletion
GeoModelCore/GeoModelKernel/GeoModelKernel/RCBase.h
+
1
−
1
View file @
857e4554
/*
/*
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/
*/
/**
/**
...
...
This diff is collapsed.
Click to expand it.
GeoModelCore/GeoModelKernel/tests/testCellBinning.cxx
0 → 100644
+
72
−
0
View file @
857e4554
/*
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/
#include
"GeoModelKernel/CellBinning.h"
#include
<exception>
#include
<gtest/gtest.h>
#define GTEST_COUT std::cerr << "[ MESSAGE ] "
class
CellBinningFixture
:
public
::
testing
::
Test
{
protected:
CellBinning
cb
{
1.
,
10.
,
10
,
1
};
};
TEST
(
CellBinning
,
CanBeConstructed
)
{
EXPECT_NO_THROW
(
CellBinning
cb
(
1.
,
10.
,
10
,
1.
));
}
TEST
(
CellBinning
,
CanBeMoveAndCopyConstructed
)
{
EXPECT_TRUE
(
std
::
is_copy_constructible_v
<
CellBinning
>
);
EXPECT_TRUE
(
std
::
is_move_constructible_v
<
CellBinning
>
);
}
TEST
(
CellBinning
,
CanBeMoveAndCopyAssigned
)
{
EXPECT_TRUE
(
std
::
is_copy_assignable_v
<
CellBinning
>
);
EXPECT_TRUE
(
std
::
is_move_assignable_v
<
CellBinning
>
);
}
TEST
(
CellBinning
,
DISABLED_EndValMustBeGreaterThanStartVal
)
{
EXPECT_THROW
(
CellBinning
cb
(
10.
,
1.
,
10
,
1
),
std
::
exception
);
}
TEST
(
CellBinning
,
DISABLED_NumBinsCannotBeZero
)
{
EXPECT_THROW
(
CellBinning
cb
(
10.
,
1.
,
0
,
1
),
std
::
exception
);
}
TEST
(
CellBinning
,
DISABLED_NumBinsMustBePositive
)
{
EXPECT_THROW
(
CellBinning
cb
(
10.
,
1.
,
-
3
,
1
),
std
::
exception
);
}
TEST_F
(
CellBinningFixture
,
lowerBinIsOk
){
EXPECT_EQ
(
cb
.
binLower
(
2
),
1.9
);
}
TEST_F
(
CellBinningFixture
,
upperBinIsOk
){
EXPECT_EQ
(
cb
.
binUpper
(
2
),
2.8
);
}
TEST_F
(
CellBinningFixture
,
centreBinIsOk
){
EXPECT_EQ
(
cb
.
binCenter
(
2
),
2.35
);
}
TEST_F
(
CellBinningFixture
,
startBinIsOk
){
EXPECT_EQ
(
cb
.
getStart
(),
1.0
);
}
TEST_F
(
CellBinningFixture
,
endBinIsOk
){
EXPECT_EQ
(
cb
.
getEnd
(),
10.0
);
}
TEST_F
(
CellBinningFixture
,
numDivisionsIsOk
){
EXPECT_EQ
(
cb
.
getNumDivisions
(),
10
);
}
TEST_F
(
CellBinningFixture
,
getDeltaIsOk
){
EXPECT_EQ
(
cb
.
getDelta
(),
0.9
);
}
TEST_F
(
CellBinningFixture
,
firstDivisionNumberIsOk
){
EXPECT_EQ
(
cb
.
getFirstDivisionNumber
(),
1
);
}
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