test_quantity.cxx
Go to the documentation of this file.
2 #include "WireCellUtil/Testing.h"
3 #include <iostream>
4 
5 using namespace WireCell;
6 using namespace std;
7 
8 int main()
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 }
int main()
STL namespace.
#define Assert
Definition: Testing.h:7
#define a2
Definition: Main.h:22
QTextStream & endl(QTextStream &s)
#define a1