Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JMultiEquals.cc File Reference

Example program to test JLANG::JMultiEquals class. More...

#include <iostream>
#include <iomanip>
#include "JLang/JEquals.hh"
#include "JLang/JMultiEquals.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Macros

#define PRINT(OUT, OP, A, B)
 Print.
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JLANG::JMultiEquals class.

Author
mdejong

Definition in file JMultiEquals.cc.

Macro Definition Documentation

◆ PRINT

#define PRINT ( OUT,
OP,
A,
B )
Value:
OUT << "(" << A << ") " << #OP " (" << B << ") => " << (A OP B) << std::endl;

Print.

Parameters
OUToutput stream
OPoperator
Afirst object
Bsecond object

Definition at line 113 of file JMultiEquals.cc.

113#define PRINT(OUT,OP,A,B) \
114 OUT << "(" << A << ") " << #OP " (" << B << ") => " << (A OP B) << std::endl;

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 123 of file JMultiEquals.cc.

124{
125 using namespace std;
126 using namespace JPP;
127
128 int debug;
129
130 try {
131
132 JParser<> zap("Example program to test object comparisons.");
133
134 zap['d'] = make_field(debug) = 3;
135
136 zap(argc, argv);
137 }
138 catch(const exception &error) {
139 FATAL(error.what() << endl);
140 }
141
142 __C__ c1(1,1);
143 __C__ c2(1,1);
144 __C__ c3(0,1);
145 __C__ c4(1,0);
146
147 PRINT(cout, ==, c1, c2);
148 PRINT(cout, !=, c1, c2);
149 PRINT(cout, ==, c1, c3);
150 PRINT(cout, !=, c1, c3);
151 PRINT(cout, ==, c1, c4);
152 PRINT(cout, !=, c1, c4);
153
154 ASSERT(c1 == c2);
155 ASSERT(c1 != c3);
156 ASSERT(c1 == c4);
157
158 __D__ d1(1,1);
159 __D__ d2(1,1);
160 __D__ d3(0,1);
161 __D__ d4(1,0);
162
163 PRINT(cout, ==, d1, d2);
164 PRINT(cout, !=, d1, d2);
165 PRINT(cout, ==, d1, d3);
166 PRINT(cout, !=, d1, d3);
167 PRINT(cout, ==, d1, d4);
168 PRINT(cout, !=, d1, d4);
169
170 ASSERT(d1 == d2);
171 ASSERT(d1 != d3);
172 ASSERT(d1 != d4);
173
174 return 0;
175}
TCanvas * c1
Global variables to handle mouse events.
#define ASSERT(A,...)
Assert macro.
Definition JMessage.hh:90
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define PRINT(OUT, OP, A, B)
Print.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).