#include "../FileChannelMappingService.h"
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
Go to the source code of this file.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
int test_FileChannelMappingService |
( |
string |
fname | ) |
|
Definition at line 25 of file test_FileChannelMappingService.cxx.
26 const string myname =
"test_FileChannelMappingService: ";
28 cout << myname <<
"NDEBUG must be off." <<
endl;
31 const string line =
"-----------------------------";
33 cout << myname << line <<
endl;
34 cout << myname <<
"Create channel mapping service." <<
endl;
39 cout << myname << line <<
endl;
40 cout << myname <<
"Fetch offline channels." <<
endl;
43 cout << myname <<
setw(w) <<
"online" <<
setw(w) <<
"offline" <<
endl;
44 for (
unsigned int chin=0; chin<maxch; ++chin ) {
45 cout << myname <<
setw(w) << chin <<
setw(w) << mapsvc.offline(chin) <<
endl;
48 cout << myname << line <<
endl;
49 cout << myname <<
"Fetch online channels." <<
endl;
50 cout << myname <<
setw(w) <<
"offline" <<
setw(w) <<
"online" <<
endl;
51 for (
unsigned int chin=0; chin<maxch; ++chin ) {
52 cout << myname <<
setw(w) << chin <<
setw(w) << mapsvc.online(chin) <<
endl;
55 cout << myname << line <<
endl;
56 cout << myname <<
"Check mapping failures raise exceptions." <<
endl;
60 cout << myname <<
"ERROR: Invalid online channel did not raise exception!" <<
endl;
63 cout << myname <<
"Invalid online channel raised exception." <<
endl;
67 cout << myname <<
"ERROR: Invalid offline channel did not raise exception!" <<
endl;
70 cout << myname <<
"Invalid offline channel raised exception." <<
endl;
73 cout << myname << line <<
endl;
74 cout << myname <<
"Check map consistency." <<
endl;
75 for (
Channel chin=0; chin<nch; ++chin ) {
76 Channel choff = mapsvc.offline(chin);
77 Channel chon = mapsvc.online(choff);
78 assert( chon == chin );
81 cout << myname << line <<
endl;
82 cout << myname <<
"Done." <<
endl;
Q_EXPORT QTSManip setw(int w)
void line(double t, double *p, double &x, double &y, double &z)
void put(std::string const &key)
QTextStream & endl(QTextStream &s)
ChannelMappingService::Channel Channel