1 /* $Id: test_boost_time.cpp,v 1.5 2005-10-15 14:09:09 adam Exp $
2 Copyright (c) 2005, Index Data.
9 #include "boost/date_time/posix_time/posix_time.hpp"
11 #define BOOST_AUTO_TEST_MAIN
12 #include <boost/test/auto_unit_test.hpp>
14 using namespace boost::unit_test;
18 BOOST_AUTO_TEST_CASE( testboosttime1 )
24 boost::posix_time::ptime now
25 = boost::posix_time::microsec_clock::local_time();
26 //std::cout << now << std::endl;
30 boost::posix_time::ptime then
31 = boost::posix_time::microsec_clock::local_time();
32 //std::cout << then << std::endl;
34 boost::posix_time::time_period period(now, then);
35 //std::cout << period << std::endl;
37 boost::posix_time::time_duration duration = then - now;
38 //std::cout << duration << std::endl;
40 BOOST_CHECK (duration.total_seconds() == 1);
41 BOOST_CHECK (duration.fractional_seconds() > 0);
44 catch (std::exception &e) {
45 std::cout << e.what() << "\n";
56 * indent-tabs-mode: nil
57 * c-file-style: "stroustrup"
59 * vim: shiftwidth=4 tabstop=8 expandtab