IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
corsika-data
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
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
Air Shower Physics
corsika-data
Commits
8ffafdb2
Commit
8ffafdb2
authored
4 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
fix the non-boost case, and tests
parent
264edd6a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
readLib/CMakeLists.txt
+7
-7
7 additions, 7 deletions
readLib/CMakeLists.txt
readLib/source/Interface.dummy.cc
+7
-11
7 additions, 11 deletions
readLib/source/Interface.dummy.cc
readLib/source/testData.cc
+4
-3
4 additions, 3 deletions
readLib/source/testData.cc
with
18 additions
and
21 deletions
readLib/CMakeLists.txt
+
7
−
7
View file @
8ffafdb2
find_package
(
Boost OPTIONAL_COMPONENTS iostreams
)
if
(
Boost_
iostreams
_FOUND
)
if
(
Boost_
IOSTREAMS
_FOUND
)
set
(
files
source/Interface.boost.cc
)
else
(
Boost_
iostreams
_FOUND
)
else
(
Boost_
IOSTREAMS
_FOUND
)
message
(
STATUS
"Boost::iostreams not found, data tables need to be unpacked with bunzip2 manually!"
)
set
(
files
source/Interface.dummy.cc
)
endif
(
Boost_
iostreams
_FOUND
)
endif
(
Boost_
IOSTREAMS
_FOUND
)
add_library
(
CorsikaData STATIC
${
files
}
)
if
(
Boost_
iostreams
_FOUND
)
if
(
Boost_
IOSTREAMS
_FOUND
)
target_link_libraries
(
CorsikaData PUBLIC Boost::iostreams
)
endif
(
Boost_
iostreams
_FOUND
)
endif
(
Boost_
IOSTREAMS
_FOUND
)
set_target_properties
(
CorsikaData
...
...
@@ -43,9 +43,9 @@ install (
if
(
COMMAND CORSIKA_ADD_TEST
)
CORSIKA_ADD_TEST
(
testData SOURCES source/testData.cc
)
set
(
TEST_WITH_BOOST
""
)
if
(
Boost_
iostreams
_FOUND
)
if
(
Boost_
IOSTREAMS
_FOUND
)
set
(
TEST_WITH_BOOST
"TEST_WITH_BOOST"
)
endif
(
Boost_
iostreams
_FOUND
)
endif
(
Boost_
IOSTREAMS
_FOUND
)
target_compile_definitions
(
testData
...
...
This diff is collapsed.
Click to expand it.
readLib/source/Interface.dummy.cc
+
7
−
11
View file @
8ffafdb2
...
...
@@ -13,28 +13,24 @@
namespace
corsika_data
{
// the c++ interface functions
// void CorDataOpenFile(const char*) {
// std::runtime_error("Cannot read compressed data files with dummy library.");
//}
void
CorDataOpenFile
(
const
std
::
string
&
)
{
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
throw
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
}
void
CorDataFillArray
(
double
*
,
const
int
&
)
{
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
throw
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
}
void
CorDataCloseFile
()
{
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
throw
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
}
double
CorDataNextNumber
()
{
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
throw
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
return
0
;
}
void
CorDataNextText
(
std
::
string
&
)
{
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
throw
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
}
void
CorDataNextText
(
char
*
,
int
)
{
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
throw
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
}
bool
CorDataCanDeCompress
()
{
return
false
;
}
...
...
@@ -47,7 +43,7 @@ namespace corsika_data {
void
cordataclosefile_
()
{
CorDataCloseFile
();
}
double
cordatanextnumber_
()
{
return
CorDataNextNumber
();
}
void
cordatanexttext_
(
char
*
,
int
)
{
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
throw
std
::
runtime_error
(
"Cannot read compressed data files with dummy library."
);
}
int
cordatacandecompress_
()
{
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
readLib/source/testData.cc
+
4
−
3
View file @
8ffafdb2
...
...
@@ -13,6 +13,7 @@
#include
<corsika_data/Interface.h>
#include
<array>
#include
<string>
#include
<iostream>
using
namespace
std
;
...
...
@@ -33,7 +34,7 @@ TEST_CASE("Data", "[data]") {
#ifdef TEST_WITH_BOOST
auto
file
=
GENERATE
(
fileName
,
fileNameBZ2
);
auto
file
=
GENERATE
(
as
<
std
::
string
>
{},
fileName
,
fileNameBZ2
);
SECTION
(
std
::
string
(
"c++,"
)
+
file
)
{
bool
b
=
CorDataCanDeCompress
();
...
...
@@ -104,8 +105,8 @@ TEST_CASE("Data", "[data]") {
CHECK_THROWS
(
cordataclosefile_
());
double
d
=
0
;
CHECK_THROWS
(
d
=
cordatanextnumber_
());
std
::
string
str
(
" "
)
;
CHECK_THROWS
(
cordatanexttext_
(
str
.
c_str
()
,
0
));
char
*
buf
=
0
;
CHECK_THROWS
(
cordatanexttext_
(
buf
,
0
));
CHECK
(
cordatacandecompress_
()
==
0
);
}
...
...
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