Commit 901274ec authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

supplemented test code

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 4581
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 3a2c2e8b
......@@ -39,6 +39,11 @@ using std::cout;
using std::endl;
using std::string;
using namespace libtime;
#define PRINTVALUE( V ) \
cout << #V << ":\n " << string(V) << endl;
/*
* first of all declare some useful functions
*/
......@@ -167,6 +172,47 @@ int main()
std::cout << Rtime.timestring() << std::endl;
std::cout << Rtime.hierarchicalstring() << std::endl;
}
std::cout << "\nSystematically test derived units"
<< "\n---------------------------------" << endl;
PRINTVALUE( Days(25.5) );
PRINTVALUE( Hours(25.5) );
PRINTVALUE( Minutes(25.5) );
PRINTVALUE( Seconds(25.5) );
PRINTVALUE( Milliseconds(25.5) );
PRINTVALUE( Microseconds(25.5) );
PRINTVALUE( Days(6) );
PRINTVALUE( Hours(6) );
PRINTVALUE( Minutes(6) );
PRINTVALUE( Seconds(6) );
PRINTVALUE( Milliseconds(6) );
PRINTVALUE( Microseconds(6) );
PRINTVALUE( Days(180) );
PRINTVALUE( Hours(180) );
PRINTVALUE( Minutes(180) );
PRINTVALUE( Seconds(180) );
PRINTVALUE( Milliseconds(180) );
PRINTVALUE( Microseconds(180) );
PRINTVALUE( Days(22,22,22,22,22,22) );
PRINTVALUE( Hours(22,22,22,22,22) );
PRINTVALUE( Minutes(22,22,22,22) );
PRINTVALUE( Seconds(22,22,22) );
PRINTVALUE( Milliseconds(22,22) );
PRINTVALUE( Microseconds(22) );
PRINTVALUE( Hours(6) );
PRINTVALUE( 118*Days()+4*Hours()+10*Minutes()+Milliseconds(25.51) );
PRINTVALUE( Minutes(34.123456) );
PRINTVALUE( Minutes(34,123,456) );
PRINTVALUE( Seconds(34.123456) );
PRINTVALUE( Seconds(34,123,456) );
PRINTVALUE( Seconds(90072) );
PRINTVALUE( 2.5*Days() );
PRINTVALUE( Days(2.5) );
PRINTVALUE( Seconds(2.5*time2double(Days())) );
}
/* ----- END OF testtime++.cc ----- */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment