ts_TimeSpan.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
22 //----------------------------------------------------------------------
23 #include <icl_core/TimeSpan.h>
24 
25 #include <boost/test/unit_test.hpp>
26 
27 using icl_core::TimeSpan;
28 
29 BOOST_AUTO_TEST_SUITE(ts_TimeSpan)
30 
31 BOOST_AUTO_TEST_CASE(ConstructFromValue)
32 {
33  TimeSpan time_span(100, 55);
34  BOOST_CHECK_EQUAL(time_span.tsSec(), 100);
35  BOOST_CHECK_EQUAL(time_span.tsNSec(), 55);
36 }
37 
38 BOOST_AUTO_TEST_CASE(ConstructFromTimespec)
39 {
40  struct timespec time_spec;
41  time_spec.tv_sec = 100;
42  time_spec.tv_nsec = 55;
43  TimeSpan time_span(time_spec);
44  BOOST_CHECK_EQUAL(time_span.tsSec(), 100);
45  BOOST_CHECK_EQUAL(time_span.tsNSec(), 55);
46 }
47 
48 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(ConstructFromValue)
Definition: ts_TimeSpan.cpp:31
time_t tv_sec
Seconds.
Definition: os_win32_time.h:36
int32_t tsNSec() const
Definition: TimeSpan.cpp:153
long tv_nsec
Nanoseconds.
Definition: os_win32_time.h:38
Repesents absolute times.
Definition: TimeSpan.h:46
int64_t tsSec() const
Definition: TimeSpan.cpp:148


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58