Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Service Desk
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
Feliks Kiszkurno
ogs-feliks
Commits
d8962cc6
Commit
d8962cc6
authored
11 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
Make the test MeshLib.UniqueMeshId test order independent.
parent
5c107a9e
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
Tests/MeshLib/TestUniqueMeshId.cpp
+12
-7
12 additions, 7 deletions
Tests/MeshLib/TestUniqueMeshId.cpp
with
12 additions
and
7 deletions
Tests/MeshLib/TestUniqueMeshId.cpp
+
12
−
7
View file @
d8962cc6
...
@@ -15,25 +15,30 @@ using namespace MeshLib;
...
@@ -15,25 +15,30 @@ using namespace MeshLib;
TEST
(
MeshLib
,
UniqueMeshId
)
TEST
(
MeshLib
,
UniqueMeshId
)
{
{
// Create first mesh
// Create first mesh
and get the current counter value.
Mesh
m0
(
"first"
,
std
::
vector
<
Node
*>
(),
std
::
vector
<
Element
*>
());
Mesh
m0
(
"first"
,
std
::
vector
<
Node
*>
(),
std
::
vector
<
Element
*>
());
ASSERT_EQ
(
std
::
size_t
(
1
),
m0
.
getID
()
)
;
std
::
size_t
const
counter_value
=
m0
.
getID
();
EXPECT_GT
(
counter_value
,
0
);
//
// Test mesh counter increments.
//
Mesh
*
m1
=
new
Mesh
(
"second"
,
std
::
vector
<
Node
*>
(),
std
::
vector
<
Element
*>
());
Mesh
*
m1
=
new
Mesh
(
"second"
,
std
::
vector
<
Node
*>
(),
std
::
vector
<
Element
*>
());
ASSERT_EQ
(
std
::
size_t
(
2
),
m1
->
getID
());
ASSERT_EQ
(
counter_value
+
std
::
size_t
(
1
),
m1
->
getID
());
Mesh
m2
(
"third"
,
std
::
vector
<
Node
*>
(),
std
::
vector
<
Element
*>
());
Mesh
m2
(
"third"
,
std
::
vector
<
Node
*>
(),
std
::
vector
<
Element
*>
());
ASSERT_EQ
(
std
::
size_t
(
3
),
m2
.
getID
());
ASSERT_EQ
(
counter_value
+
std
::
size_t
(
2
),
m2
.
getID
());
delete
m1
;
delete
m1
;
ASSERT_EQ
(
std
::
size_t
(
3
),
m2
.
getID
());
ASSERT_EQ
(
counter_value
+
std
::
size_t
(
2
),
m2
.
getID
());
Mesh
m3
(
"fourth"
,
std
::
vector
<
Node
*>
(),
std
::
vector
<
Element
*>
());
Mesh
m3
(
"fourth"
,
std
::
vector
<
Node
*>
(),
std
::
vector
<
Element
*>
());
ASSERT_EQ
(
std
::
size_t
(
4
),
m3
.
getID
());
ASSERT_EQ
(
counter_value
+
std
::
size_t
(
3
),
m3
.
getID
());
// Copy mesh keeps also increments the counter.
// Copy mesh keeps also increments the counter.
Mesh
m4
(
m0
);
Mesh
m4
(
m0
);
ASSERT_EQ
(
std
::
size_t
(
5
),
m4
.
getID
());
ASSERT_EQ
(
counter_value
+
std
::
size_t
(
4
),
m4
.
getID
());
}
}
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