summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slicer/test/conversions.cpp4
-rw-r--r--slicer/test/helpers.cpp6
2 files changed, 10 insertions, 0 deletions
diff --git a/slicer/test/conversions.cpp b/slicer/test/conversions.cpp
index 1ea6239..17ebfb0 100644
--- a/slicer/test/conversions.cpp
+++ b/slicer/test/conversions.cpp
@@ -41,7 +41,9 @@ namespace Slicer {
memset(&tm, 0, sizeof(struct tm));
auto end = strptime(in.c_str(), "%Y-%m-%d", &tm);
if (!end || *end) {
+ // LCOV_EXCL_START
throw std::runtime_error("Invalid iso-date string: " + in);
+ // LCOV_EXCL_STOP
}
return ::TestModule::IsoDate({
SHORT(tm.tm_year + 1900), SHORT(tm.tm_mon + 1), SHORT(tm.tm_mday)});
@@ -71,7 +73,9 @@ namespace Slicer {
memset(&tm, 0, sizeof(struct tm));
auto end = strptime(in.c_str(), "%Y-%b-%d %H:%M:%S", &tm);
if (!end || *end) {
+ // LCOV_EXCL_START
throw std::runtime_error("Invalid date string: " + in);
+ // LCOV_EXCL_STOP
}
return ::TestModule::DateTime({
SHORT(tm.tm_year + 1900), SHORT(tm.tm_mon + 1), SHORT(tm.tm_mday),
diff --git a/slicer/test/helpers.cpp b/slicer/test/helpers.cpp
index 58f47bc..73f3aa7 100644
--- a/slicer/test/helpers.cpp
+++ b/slicer/test/helpers.cpp
@@ -9,8 +9,10 @@ void
system(const std::string & cmd)
{
if (system(cmd.c_str())) {
+ // LCOV_EXCL_START
fprintf(stderr, "Failed to execute:\n\t%s\n", cmd.c_str());
throw std::runtime_error(cmd);
+ // LCOV_EXCL_STOP
}
}
@@ -32,7 +34,9 @@ loadlib(const boost::filesystem::path & so)
{
auto handle = dlopen(so.string().c_str(), RTLD_NOW | RTLD_GLOBAL);
if (!handle) {
+ // LCOV_EXCL_START
throw std::runtime_error(dlerror());
+ // LCOV_EXCL_STOP
}
return handle;
}
@@ -41,7 +45,9 @@ void
closelib(void * handle)
{
if (dlclose(handle)) {
+ // LCOV_EXCL_START
throw std::runtime_error(dlerror());
+ // LCOV_EXCL_STOP
}
}