duration_values_pass.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // Adaptation to Boost of the libcxx
  10. // Copyright 2010 Vicente J. Botet Escriba
  11. // Distributed under the Boost Software License, Version 1.0.
  12. // See http://www.boost.org/LICENSE_1_0.txt
  13. #include <boost/chrono/chrono.hpp>
  14. #include <boost/type_traits.hpp>
  15. #include <limits>
  16. #include <boost/detail/lightweight_test.hpp>
  17. #include "../rep.h"
  18. int main()
  19. {
  20. BOOST_TEST((boost::chrono::duration_values<int>::min)() ==
  21. (std::numeric_limits<int>::min)());
  22. BOOST_TEST((boost::chrono::duration_values<double>::min)() ==
  23. -(std::numeric_limits<double>::max)());
  24. BOOST_TEST((boost::chrono::duration_values<Rep>::min)() ==
  25. (std::numeric_limits<Rep>::min)());
  26. BOOST_TEST((boost::chrono::duration_values<int>::max)() ==
  27. (std::numeric_limits<int>::max)());
  28. BOOST_TEST((boost::chrono::duration_values<double>::max)() ==
  29. (std::numeric_limits<double>::max)());
  30. BOOST_TEST((boost::chrono::duration_values<Rep>::max)() ==
  31. (std::numeric_limits<Rep>::max)());
  32. BOOST_TEST(boost::chrono::duration_values<int>::zero() == 0);
  33. BOOST_TEST(boost::chrono::duration_values<Rep>::zero() == 0);
  34. return boost::report_errors();
  35. }