ProteoWizard
Functions
PeptideIDMapTest.cpp File Reference
#include "PeptideIDMap.hpp"
#include "pwiz/utility/misc/unit.hpp"
#include "pwiz/utility/misc/Std.hpp"

Go to the source code of this file.

Functions

void test ()
 
int main (int argc, char *argv[])
 

Function Documentation

§ test()

void test ( )

Definition at line 33 of file PeptideIDMapTest.cpp.

References pwiz::peptideid::PeptideID::Record::nativeID, pwiz::peptideid::PeptideID::Record::normalizedScore, pwiz::peptideid::PeptideIDMap::record(), pwiz::proteome::AminoAcid::Info::record(), pwiz::peptideid::PeptideID::Record::sequence, unit_assert, and unit_assert_equal.

Referenced by main().

34 {
35  PeptideIDMap peptideIDMap;
36 
37  PeptideID::Record* record = &peptideIDMap["1"];
38  record->nativeID = "1";
39  record->sequence = "DARREN";
40  record->normalizedScore = .5;
41 
42  record = &peptideIDMap["2"];
43  record->nativeID = "2";
44  record->sequence = "KESSNER";
45  record->normalizedScore = .6;
46 
47  PeptideID::Record result = peptideIDMap.record(PeptideID::Location("goober", 0, 0));
48  unit_assert(result.nativeID.empty());
49  unit_assert(result.sequence.empty());
50  unit_assert_equal(result.normalizedScore, 0, 1e-15);
51 
52  result = peptideIDMap.record(PeptideID::Location("1", 0, 0));
53  unit_assert(result.nativeID == "1");
54  unit_assert(result.sequence == "DARREN");
55  unit_assert_equal(result.normalizedScore, .5, 1e-15);
56 
57  result = peptideIDMap.record(PeptideID::Location("2", 0, 0));
58  unit_assert(result.nativeID == "2");
59  unit_assert(result.sequence == "KESSNER");
60  unit_assert_equal(result.normalizedScore, .6, 1e-15);
61 }
PWIZ_API_DECL const Record & record(Type type)
returns the amino acid's Record by type
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
virtual Record record(const pwiz::peptideid::PeptideID::Location &location) const
#define unit_assert(x)
Definition: unit.hpp:85

§ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 64 of file PeptideIDMapTest.cpp.

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

65 {
66  TEST_PROLOG(argc, argv)
67 
68  try
69  {
70  test();
71  }
72  catch (exception& e)
73  {
74  TEST_FAILED(e.what())
75  }
76  catch (...)
77  {
78  TEST_FAILED("Caught unknown exception.")
79  }
80 
82 }
void test()
#define TEST_EPILOG
Definition: unit.hpp:182
#define TEST_FAILED(x)
Definition: unit.hpp:176
#define TEST_PROLOG(argc, argv)
Definition: unit.hpp:174