diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-06-18 23:18:51 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-06-18 23:18:51 +0300 |
commit | 128ff433151efbad5585de55c3e365a982ba1acb (patch) | |
tree | 7de779b3a4e8d3b60c872ce43847ff695fbb18a0 | |
parent | e1d51e70d26ebd92ef3e24f023ff2195de03b385 (diff) |
Fix unguarded use of iostreams. Hopefully this will fix Linux Travis.
-rw-r--r-- | .travis.yml | 10 | ||||
-rw-r--r-- | example/use_cases.cpp | 1 | ||||
-rw-r--r-- | include/afio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp | 6 | ||||
-rw-r--r-- | include/afio/v2.0/detail/impl/storage_profile.ipp | 2 |
4 files changed, 14 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml index cd5fceaf..03ece0d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,8 +34,8 @@ env: global: - secure: "A3TeWTlJdjUaQ31NF60kMOik8mzaJkdKA55jZXjN83BJ2ZjMDmWfq1XmZ7iDIxmn7HC2BVpjhdkj9jpRtPztb08L5VSlJIiVbXlBWNwgzmYANujpR9rA+bhZJwlKDaYQHUZUd4+iGHCHb0dLt2HG0eHF5azaifd0YqCfz5GcWl8=" matrix: - - __="cmake tests (error_code)" NAME=TravisLinuxWorker CMAKE_CONFIGURE_OPTIONS= - - __="cmake tests (status_code)" NAME=TravisLinuxWorker CMAKE_CONFIGURE_OPTIONS=-DAFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON + - __="cmake tests (error_code)" NAME=TravisLinuxWorkerEC CMAKE_CONFIGURE_OPTIONS= + - __="cmake tests (status_code)" NAME=TravisLinuxWorkerSC CMAKE_CONFIGURE_OPTIONS=-DAFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON - __="cmake tests" NAME=TravisOSXWorker - __="Documentation" NAME=TravisDocumentation - __="Programs" @@ -47,9 +47,9 @@ matrix: - os: osx env: __="Documentation" NAME=TravisDocumentation - os: osx - env: __="cmake tests (error_code)" NAME=TravisLinuxWorker CMAKE_CONFIGURE_OPTIONS= + env: __="cmake tests (error_code)" NAME=TravisLinuxWorkerEC CMAKE_CONFIGURE_OPTIONS= - os: osx - env: __="cmake tests (status_code)" NAME=TravisLinuxWorker CMAKE_CONFIGURE_OPTIONS=-DAFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON + env: __="cmake tests (status_code)" NAME=TravisLinuxWorkerSC CMAKE_CONFIGURE_OPTIONS=-DAFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON - os: linux compiler: g++ env: __="Documentation" NAME=TravisDocumentation @@ -81,7 +81,7 @@ before_install: export CMAKE_CONFIGURE_OPTIONS="$CMAKE_CONFIGURE_OPTIONS -DCMAKE_LIBRARY_PATH=/usr/local/opt/llvm/lib"; fi - if [ "$CXX" = "g++" ]; then export CXX=g++-6; export NAME=TravisLinuxWorkerGCC; fi; - - if [ "$CXX" = "clang++" ]; then export CXX=clang++-4.0; export NAME=TravisLinuxWorkerClang; fi; + - if [ "$CXX" = "clang++" ]; then export CXX=clang++-4.0; fi; - git checkout develop - git submodule update --init --recursive - mount diff --git a/example/use_cases.cpp b/example/use_cases.cpp index 9c039c5f..1df10604 100644 --- a/example/use_cases.cpp +++ b/example/use_cases.cpp @@ -25,6 +25,7 @@ Distributed under the Boost Software License, Version 1.0. #include "../include/afio.hpp" #include <future> +#include <iostream> #include <vector> // clang-format off diff --git a/include/afio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp b/include/afio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp index 3c140030..321f1bff 100644 --- a/include/afio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp +++ b/include/afio/v2.0/algorithm/shared_fs_mutex/memory_map.hpp @@ -179,7 +179,9 @@ namespace algorithm if(!o2) { AFIO_LOG_FATAL(0, "memory_map::~memory_map() truncate failed"); +#ifndef NDEBUG std::cerr << "~memory_map() truncate failed due to " << o2.error().message().c_str() << std::endl; +#endif abort(); } // Unlink the temp file. We don't trap any failure to unlink on FreeBSD it can forget current path. @@ -187,10 +189,14 @@ namespace algorithm if(!o3) { #ifdef __FreeBSD__ +#ifndef NDEBUG std::cerr << "~memory_map() unlink failed due to " << o3.error().message().c_str() << std::endl; +#endif #else AFIO_LOG_FATAL(0, "memory_map::~memory_map() unlink failed"); +#ifndef NDEBUG std::cerr << "~memory_map() unlink failed due to " << o3.error().message().c_str() << std::endl; +#endif abort(); #endif } diff --git a/include/afio/v2.0/detail/impl/storage_profile.ipp b/include/afio/v2.0/detail/impl/storage_profile.ipp index cc1ac9fc..b442f74a 100644 --- a/include/afio/v2.0/detail/impl/storage_profile.ipp +++ b/include/afio/v2.0/detail/impl/storage_profile.ipp @@ -1042,7 +1042,9 @@ namespace storage_profile result.clear(); result.shrink_to_fit(); } +#ifndef NDEBUG std::cout << "Total results = " << totalresults.size() << std::endl; +#endif s.mean = static_cast<unsigned long long>(static_cast<double>(sum) / totalresults.size()); // Latency distributions are definitely not normally distributed, but here we have the // advantage of tons of sample points. So simply sort into order, and pluck out the values |