Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include <gtest/gtest.h>
00009 #include <mrpt_bridge/time.h>
00010 #define __STDC_FORMAT_MACROS
00011 #include <inttypes.h>
00012 #include <boost/date_time/posix_time/time_formatters.hpp>
00013 #include <boost/date_time/posix_time/posix_time.hpp>
00014
00015 TEST(Time, basicTest)
00016 {
00017 mrpt::system::TTimeStamp mtime = mrpt::system::getCurrentLocalTime( );
00018 ros::Time rtimeDes;
00019 mrpt::system::TTimeStamp mtimeDes;
00020 mrpt_bridge::convert(mtime, rtimeDes);
00021 mrpt_bridge::convert(rtimeDes, mtimeDes);
00022 std::cout << "TimeNow: " << boost::posix_time::to_simple_string(rtimeDes.toBoost()) << std::endl;
00023 EXPECT_EQ(mtime, mtimeDes);
00024 }