Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JUnity.cc File Reference

Example program to test unity values (JMATH::unity). More...

#include <iostream>
#include <iomanip>
#include "JMath/JUnity.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Classes

struct  JMATH::JUnityHelper<::__A__, false >
 Template specialisation of JMATH::JUnityHelper for class __A__. More...
 

Namespaces

namespace  JMATH
 Auxiliary classes and methods for mathematical operations.
 

Macros

#define PRINT(OUT, CLASS)
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test unity values (JMATH::unity).

Author
bjung

Definition in file JUnity.cc.

Macro Definition Documentation

◆ PRINT

#define PRINT ( OUT,
CLASS )
Value:
print<CLASS>(OUT, #CLASS)
void print(const TH1 &h1, std::ostream &out)
Print histogram parameters.

Definition at line 87 of file JUnity.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 116 of file JUnity.cc.

117{
118 using namespace std;
119
120 int debug;
121
122 try {
123
124 JParser<> zap("Example program to test unity values of non-primitive data types.");
125
126 zap['d'] = make_field(debug) = 3;
127
128 zap(argc, argv);
129 }
130 catch(const exception &error) {
131 FATAL(error.what() << endl);
132 }
133
134 using namespace JPP;
135
136 PRINT(cout, int);
137 PRINT(cout, float);
138 PRINT(cout, double);
139 PRINT(cout, __A__);
140
141 ASSERT(is_equal<int> (1));
142 ASSERT(is_equal<float> (1.0));
143 ASSERT(is_equal<double>(1.0));
144 ASSERT(is_equal<__A__> (__A__(1.0)));
145
146 return 0;
147}
#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 make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
#define PRINT(OUT, CLASS)
Definition JUnity.cc:87
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).