Functions
test_quantity.cxx File Reference
#include "WireCellUtil/Quantity.h"
#include "WireCellUtil/Testing.h"
#include <iostream>

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

int main ( void  )

Definition at line 8 of file test_quantity.cxx.

9 {
10  cout << Quantity() << endl;
11 
12  Quantity a1(5,1), b1(2,3);
13  Quantity a2(5,2), b2(2,.1);
14 
15  cout << 1 << a1 << " * " << b1 << " = " << a1*b1 << endl;
16  cout << 2 << a1 << " / " << b1 << " = " << a1/b1 << endl;
17  cout << 3 << a1 << " + " << b1 << " = " << a1+b1 << endl;
18  cout << 4 << a1 << " - " << b1 << " = " << a1-b1 << endl;
19  cout << 4 << "-" << a1 << " = " << -a1 << endl;
20 
21  Assert(a1 < 10.0);
22  Assert(a1 > 4.0);
23  Assert(a1 == 5.0);
24  Assert(a1 == a2);
25  Assert(a1 != b1);
26  Assert(a1 != 3.0);
27 
28  Assert(b1 < a1);
29  Assert(a1 > b1);
30 
31 }
#define Assert
Definition: Testing.h:7
#define a2
QTextStream & endl(QTextStream &s)
#define a1