ProteoWizard
ChromatogramListBaseTest.cpp
Go to the documentation of this file.
1//
2// $Id$
3//
4//
5// Original author: Darren Kessner <darren@proteowizard.org>
6//
7// Copyright 2009 Spielberg Family Center for Applied Proteomics
8// Cedars Sinai Medical Center, Los Angeles, California 90048
9//
10// Licensed under the Apache License, Version 2.0 (the "License");
11// you may not use this file except in compliance with the License.
12// You may obtain a copy of the License at
13//
14// http://www.apache.org/licenses/LICENSE-2.0
15//
16// Unless required by applicable law or agreed to in writing, software
17// distributed under the License is distributed on an "AS IS" BASIS,
18// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19// See the License for the specific language governing permissions and
20// limitations under the License.
21//
22
23
27
28using namespace pwiz::msdata;
29using namespace pwiz::util;
30
31
33{
34 public:
35 virtual size_t size() const {return 0;}
36 virtual const ChromatogramIdentity& chromatogramIdentity(size_t index) const {throw runtime_error("heh");}
37 virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData = false) const {return ChromatogramPtr();}
38};
39
40
41void test()
42{
43 MyBase base;
45 base.setDataProcessingPtr(dp);
46 unit_assert(base.dataProcessingPtr().get() == dp.get());
47}
48
49
50int main(int argc, char* argv[])
51{
52 TEST_PROLOG(argc, argv)
53
54 try
55 {
56 test();
57 }
58 catch (exception& e)
59 {
60 TEST_FAILED(e.what())
61 }
62 catch (...)
63 {
64 TEST_FAILED("Caught unknown exception.")
65 }
66
68}
69
70
int main(int argc, char *argv[])
virtual const ChromatogramIdentity & chromatogramIdentity(size_t index) const
access to a chromatogram index
virtual size_t size() const
returns the number of chromatograms
virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData=false) const
retrieve a chromatogram by index
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
implementation of ChromatogramList
common functionality for base ChromatogramList implementations
virtual void setDataProcessingPtr(DataProcessingPtr dp)
set DataProcessing
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition MSData.hpp:288
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition MSData.hpp:624
Identifying information for a chromatogram.
Definition MSData.hpp:490
Description of the way in which a particular software was used.
Definition MSData.hpp:274
#define unit_assert(x)
Definition unit.hpp:85
#define TEST_EPILOG
Definition unit.hpp:183
#define TEST_FAILED(x)
Definition unit.hpp:177
#define TEST_PROLOG(argc, argv)
Definition unit.hpp:175