#include "SampleDatum.hpp"
#include "pwiz/utility/misc/unit.hpp"
#include "pwiz/utility/misc/Std.hpp"
#include <complex>
#include <cstring>
Go to the source code of this file.
|
template<typename abscissa_type , typename ordinate_type > |
void | test () |
|
int | main (int argc, char *argv[]) |
|
◆ test()
template<typename abscissa_type , typename ordinate_type >
Definition at line 39 of file SampleDatumTest.cpp.
40{
42
43 vector<sd_type> v;
44 v.push_back(sd_type(1,2));
45 v.push_back(sd_type(3,4));
46 v.push_back(sd_type(5,6));
47
48
49 ostringstream oss;
50 copy(v.begin(), v.end(), ostream_iterator<sd_type>(oss, "\n"));
51 if (
os_) *
os_ << oss.str();
52
53
54 vector<sd_type> w;
55 istringstream iss(oss.str());
56 copy(istream_iterator<sd_type>(iss), istream_iterator<sd_type>(), back_inserter(w));
57
58
60}
References os_, and unit_assert.
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 63 of file SampleDatumTest.cpp.
64{
66
67 try
68 {
69 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
70 if (
os_) *
os_ <<
"SampleDatumTest\n";
71
72 test<int,int>();
73 test<double,double>();
74 test< double,complex<double> >();
75 test< complex<double>,complex<double> >();
76
77 }
78 catch (exception& e)
79 {
81 }
82 catch (...)
83 {
85 }
86
88}
#define TEST_PROLOG(argc, argv)
References os_, TEST_EPILOG, TEST_FAILED, and TEST_PROLOG.
◆ os_