Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Dmitri Naumov
ogs
Commits
b17357a8
Commit
b17357a8
authored
6 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
adding test for point to station conversion
parent
70ed0b57
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tests/Data/MeshGeoToolsLib/Hamburg/BrunnenGOK_Outline_ModellHH.gml
+3
-0
3 additions, 0 deletions
...a/MeshGeoToolsLib/Hamburg/BrunnenGOK_Outline_ModellHH.gml
Tests/GeoLib/TestPointToStationConversion.cpp
+55
-0
55 additions, 0 deletions
Tests/GeoLib/TestPointToStationConversion.cpp
with
58 additions
and
0 deletions
Tests/Data/MeshGeoToolsLib/Hamburg/BrunnenGOK_Outline_ModellHH.gml
0 → 100644
LFS
+
3
−
0
View file @
b17357a8
Source diff could not be displayed: it is stored in LFS. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
Tests/GeoLib/TestPointToStationConversion.cpp
0 → 100644
+
55
−
0
View file @
b17357a8
/**
* @brief Tests for GeoLib::GEOOnjects::geoPointsToStations()
*
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/LICENSE.txt
*/
#include
"gtest/gtest.h"
#include
"BaseLib/BuildInfo.h"
#include
"GeoLib/GEOObjects.h"
#include
"GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h"
TEST
(
GeoLib
,
PointToStationConversion
)
{
std
::
string
const
file_name
(
BaseLib
::
BuildInfo
::
data_path
+
"/MeshGeoToolsLib/Hamburg/BrunnenGOK_Outline_ModellHH.gml"
);
GeoLib
::
GEOObjects
geo_obj
;
GeoLib
::
IO
::
BoostXmlGmlInterface
io
(
geo_obj
);
bool
const
ret
=
io
.
readFile
(
file_name
);
EXPECT_TRUE
(
ret
);
std
::
vector
<
std
::
string
>
geo_names
;
geo_obj
.
getGeometryNames
(
geo_names
);
auto
const
*
const
pnts
=
geo_obj
.
getPointVec
(
geo_names
[
0
]);
assert
(
pnts
!=
nullptr
);
std
::
size_t
const
exp_all_pnts
(
310
);
EXPECT_EQ
(
exp_all_pnts
,
pnts
->
size
());
// converting only unused points
std
::
string
stn_orphaned_pnts
(
"Orphaned Points"
);
int
const
res_orphaned_pnts
=
geo_obj
.
geoPointsToStations
(
geo_names
[
0
],
stn_orphaned_pnts
,
true
);
EXPECT_EQ
(
0
,
res_orphaned_pnts
);
auto
const
*
const
stns
=
geo_obj
.
getStationVec
(
stn_orphaned_pnts
);
assert
(
stns
!=
nullptr
);
std
::
size_t
const
n_stns
=
stns
->
size
();
EXPECT_EQ
(
18
,
n_stns
);
for
(
std
::
size_t
i
=
0
;
i
<
n_stns
;
++
i
)
{
EXPECT_EQ
((
*
(
*
stns
)[
i
])[
0
],
(
*
(
*
pnts
)[
i
])[
0
]);
EXPECT_EQ
((
*
(
*
stns
)[
i
])[
1
],
(
*
(
*
pnts
)[
i
])[
1
]);
EXPECT_EQ
((
*
(
*
stns
)[
i
])[
2
],
(
*
(
*
pnts
)[
i
])[
2
]);
}
// converting all points
std
::
string
stn_all_pnts
(
"All Points"
);
int
const
res_all_pnts
=
geo_obj
.
geoPointsToStations
(
geo_names
[
0
],
stn_all_pnts
,
false
);
EXPECT_EQ
(
0
,
res_all_pnts
);
EXPECT_EQ
(
exp_all_pnts
,
geo_obj
.
getStationVec
(
stn_all_pnts
)
->
size
());
}
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