From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/libs/icl/test/chrono/utility.hpp | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/boost/libs/icl/test/chrono/utility.hpp (limited to 'src/boost/libs/icl/test/chrono') diff --git a/src/boost/libs/icl/test/chrono/utility.hpp b/src/boost/libs/icl/test/chrono/utility.hpp new file mode 100644 index 00000000..5c12e31b --- /dev/null +++ b/src/boost/libs/icl/test/chrono/utility.hpp @@ -0,0 +1,49 @@ +/*-----------------------------------------------------------------------------+ +Copyright (c) 2011-2011: Joachim Faulhaber ++------------------------------------------------------------------------------+ + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENCE.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) ++-----------------------------------------------------------------------------*/ +#ifndef BOOST_LIBS_ICL_TEST_CHRONO_UTILITY_HPP_JOFA_20110314 +#define BOOST_LIBS_ICL_TEST_CHRONO_UTILITY_HPP_JOFA_20110314 + +#include +#include + +// In order to perform simple testing with chrono::time_point +// we need to provide a dummy test clock + +class Now // A trivial test clock +{ +public: + typedef boost::chrono::duration duration; + typedef duration::rep rep; + typedef duration::period periond; + typedef boost::chrono::time_point time_point; + + static time_point now(){ return time_point(); } +}; + +namespace boost{ namespace chrono { + +template +struct clock_string +{ + static std::basic_string name() + { + static const CharT u[] = {'n', 'o', 'w', '_', 'c', 'l','o', 'c', 'k'}; + static const std::basic_string str(u, u + sizeof(u)/sizeof(u[0])); + return str; + } + static std::basic_string since() + { + const CharT u[] = {' ', 's', 'i', 'n', 'c', 'e', ' ', 'n', 'o', 'w'}; + const std::basic_string str(u, u + sizeof(u)/sizeof(u[0])); + return str; + } +}; + +}} //namespace boost chrono + +#endif //BOOST_LIBS_ICL_TEST_CHRONO_UTILITY_HPP_JOFA_20110314 -- cgit v1.2.3