Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
util
test
test_quantity.cxx
Go to the documentation of this file.
1
#include "
WireCellUtil/Quantity.h
"
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
}
main
int main()
Definition:
test_quantity.cxx:8
std
STL namespace.
Assert
#define Assert
Definition:
Testing.h:7
a2
#define a2
Definition:
HoughBaseAlg.cxx:64
Testing.h
WireCell
Definition:
Main.h:22
Quantity.h
WireCell::Quantity
Definition:
Quantity.h:16
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
a1
#define a1
Definition:
HoughBaseAlg.cxx:63
Generated by
1.8.11