ProteoWizard
Macros | Functions | Variables
Serializer_mzid_Test.cpp File Reference
#include "pwiz/utility/misc/unit.hpp"
#include "pwiz/utility/misc/Std.hpp"
#include "IdentData.hpp"
#include "Serializer_mzid.hpp"
#include "examples.hpp"
#include "Diff.hpp"

Go to the source code of this file.

Macros

#define PWIZ_SOURCE
 

Functions

void testSerialize ()
 
void test ()
 
int main (int argc, char **argv)
 

Variables

ostream * os_ = 0
 

Macro Definition Documentation

◆ PWIZ_SOURCE

#define PWIZ_SOURCE

Definition at line 23 of file Serializer_mzid_Test.cpp.

Function Documentation

◆ testSerialize()

void testSerialize ( )

Definition at line 41 of file Serializer_mzid_Test.cpp.

42{
43 if (os_) *os_ << "begin testSerialize\n";
44 IdentData mzid;
45 initializeTiny(mzid);
46
48 ostringstream oss;
49 ser.write(oss, mzid);
50
51 if (os_) *os_ << oss.str() << endl;
52
53 IdentData mzid2;
54 boost::shared_ptr<istream> iss(new istringstream(oss.str()));
55 ser.read(iss, mzid2);
57
58 if (os_ && diff) *os_ << diff << endl;
60}
void diff(const string &filename1, const string &filename2)
ostream * os_
MZIDData <-> mzIdentML stream serialization.
void write(std::ostream &os, const IdentData &mzid, const pwiz::util::IterationListenerRegistry *=0) const
write MZIDData object to ostream as mzIdentML
void read(boost::shared_ptr< std::istream > is, IdentData &mzid, const pwiz::util::IterationListenerRegistry *=0) const
read in MZIDData object from a mzIdentML istream
PWIZ_API_DECL void initializeTiny(IdentData &mzid)
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition diff_std.hpp:143
Implementation of the MzIdentMLType from the mzIdentML schema.
#define unit_assert(x)
Definition unit.hpp:85

References diff(), pwiz::identdata::examples::initializeTiny(), os_, pwiz::identdata::Serializer_mzIdentML::read(), unit_assert, and pwiz::identdata::Serializer_mzIdentML::write().

Referenced by main(), and test().

◆ test()

void test ( )

Definition at line 62 of file Serializer_mzid_Test.cpp.

63{
65}
void testSerialize()

References testSerialize().

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 67 of file Serializer_mzid_Test.cpp.

68{
69 TEST_PROLOG(argc, argv)
70
71 try
72 {
73 if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
74 test();
75 }
76 catch (exception& e)
77 {
78 TEST_FAILED(e.what())
79 }
80 catch (...)
81 {
82 TEST_FAILED("Caught unknown exception.")
83 }
84
86}
void test()
#define TEST_EPILOG
Definition unit.hpp:183
#define TEST_FAILED(x)
Definition unit.hpp:177
#define TEST_PROLOG(argc, argv)
Definition unit.hpp:175

References os_, test(), TEST_EPILOG, TEST_FAILED, and TEST_PROLOG.

Variable Documentation

◆ os_

ostream* os_ = 0

Definition at line 38 of file Serializer_mzid_Test.cpp.

Referenced by main(), and testSerialize().