ProteoWizard
Functions | Variables
Serializer_mzML_Test.cpp File Reference
#include "Serializer_mzML.hpp"
#include "Diff.hpp"
#include "References.hpp"
#include "examples.hpp"
#include "pwiz/utility/misc/unit.hpp"
#include "boost/iostreams/positioning.hpp"
#include "pwiz/utility/misc/Std.hpp"
#include <cstring>

Go to the source code of this file.

Functions

void testWriteRead (const MSData &msd, const Serializer_mzML::Config &config)
void testWriteRead ()
int main (int argc, char *argv[])

Variables

ostream * os_ = 0

Function Documentation

void testWriteRead ( const MSData msd,
const Serializer_mzML::Config config 
)

Definition at line 42 of file Serializer_mzML_Test.cpp.

References diff(), os_, pwiz::msdata::Serializer_mzML::read(), pwiz::identdata::References::resolve(), unit_assert, and pwiz::msdata::Serializer_mzML::write().

{
if (os_) *os_ << "testWriteRead() " << config << endl;
Serializer_mzML mzmlSerializer(config);
ostringstream oss;
mzmlSerializer.write(oss, msd);
if (os_) *os_ << "oss:\n" << oss.str() << endl;
shared_ptr<istringstream> iss(new istringstream(oss.str()));
MSData msd2;
mzmlSerializer.read(iss, msd2);
if (os_ && diff) *os_ << diff << endl;
}
void testWriteRead ( )
int main ( int  argc,
char *  argv[] 
)

Definition at line 84 of file Serializer_mzML_Test.cpp.

References e(), os_, TEST_EPILOG, TEST_FAILED, TEST_PROLOG, and testWriteRead().

{
TEST_PROLOG(argc, argv)
try
{
if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
}
catch (exception& e)
{
TEST_FAILED(e.what())
}
catch (...)
{
TEST_FAILED("Caught unknown exception.")
}
}

Variable Documentation

ostream* os_ = 0

Definition at line 39 of file Serializer_mzML_Test.cpp.