3879 |
13 Mar 20 |
peter |
// $Id$ |
3879 |
13 Mar 20 |
peter |
2 |
// |
3879 |
13 Mar 20 |
peter |
// Copyright (C) 2020 Peter Johansson |
3879 |
13 Mar 20 |
peter |
4 |
// |
3879 |
13 Mar 20 |
peter |
// This program is free software; you can redistribute it and/or modify |
3879 |
13 Mar 20 |
peter |
// it under the terms of the GNU General Public License as published by |
3879 |
13 Mar 20 |
peter |
// the Free Software Foundation; either version 3 of the License, or |
3879 |
13 Mar 20 |
peter |
// (at your option) any later version. |
3879 |
13 Mar 20 |
peter |
9 |
// |
3879 |
13 Mar 20 |
peter |
// This program is distributed in the hope that it will be useful, but |
3879 |
13 Mar 20 |
peter |
// WITHOUT ANY WARRANTY; without even the implied warranty of |
3879 |
13 Mar 20 |
peter |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3879 |
13 Mar 20 |
peter |
// General Public License for more details. |
3879 |
13 Mar 20 |
peter |
14 |
// |
3879 |
13 Mar 20 |
peter |
// You should have received a copy of the GNU General Public License |
3879 |
13 Mar 20 |
peter |
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
3879 |
13 Mar 20 |
peter |
17 |
|
3879 |
13 Mar 20 |
peter |
18 |
#include <config.h> |
3879 |
13 Mar 20 |
peter |
19 |
|
3883 |
24 Mar 20 |
peter |
20 |
#ifdef YAT_HAVE_HTSLIB |
3879 |
13 Mar 20 |
peter |
21 |
#include "yat/omic/BamPair.h" |
3879 |
13 Mar 20 |
peter |
22 |
#endif |
3879 |
13 Mar 20 |
peter |
23 |
|
3879 |
13 Mar 20 |
peter |
24 |
#include <cassert> |
3879 |
13 Mar 20 |
peter |
25 |
#include <string> |
3879 |
13 Mar 20 |
peter |
26 |
|
3879 |
13 Mar 20 |
peter |
27 |
#include "Suite.h" |
3879 |
13 Mar 20 |
peter |
28 |
|
3879 |
13 Mar 20 |
peter |
29 |
using namespace theplu::yat; |
3879 |
13 Mar 20 |
peter |
30 |
|
3879 |
13 Mar 20 |
peter |
31 |
void test1(test::Suite& suite); |
3879 |
13 Mar 20 |
peter |
32 |
|
3879 |
13 Mar 20 |
peter |
33 |
int main(int argc, char* argv[]) |
3879 |
13 Mar 20 |
peter |
34 |
{ |
3879 |
13 Mar 20 |
peter |
35 |
test::Suite suite(argc, argv, true); |
3879 |
13 Mar 20 |
peter |
36 |
try { |
3879 |
13 Mar 20 |
peter |
//test1(suite); |
3879 |
13 Mar 20 |
peter |
38 |
} |
3879 |
13 Mar 20 |
peter |
39 |
catch (std::runtime_error& e) { |
3879 |
13 Mar 20 |
peter |
40 |
suite.add(false); |
3879 |
13 Mar 20 |
peter |
41 |
suite.err() << "error: what: " << e.what() << "\n"; |
3879 |
13 Mar 20 |
peter |
42 |
} |
3879 |
13 Mar 20 |
peter |
43 |
return suite.return_value(); |
3879 |
13 Mar 20 |
peter |
44 |
} |
3879 |
13 Mar 20 |
peter |
45 |
|
3883 |
24 Mar 20 |
peter |
46 |
#ifdef YAT_HAVE_HTSLIB |
3879 |
13 Mar 20 |
peter |
47 |
|
3879 |
13 Mar 20 |
peter |
48 |
omic::BamPair func_pair(const omic::BamRead& read) |
3879 |
13 Mar 20 |
peter |
49 |
{ |
3879 |
13 Mar 20 |
peter |
50 |
return omic::BamPair(read, read); |
3879 |
13 Mar 20 |
peter |
51 |
} |
3879 |
13 Mar 20 |
peter |
52 |
|
3879 |
13 Mar 20 |
peter |
53 |
|
3879 |
13 Mar 20 |
peter |
54 |
omic::BamPair func_proxy(const omic::BamRead& read) |
3879 |
13 Mar 20 |
peter |
55 |
{ |
3879 |
13 Mar 20 |
peter |
56 |
return omic::BamPairProxy(&read, &read); |
3879 |
13 Mar 20 |
peter |
57 |
} |
3879 |
13 Mar 20 |
peter |
58 |
|
3879 |
13 Mar 20 |
peter |
59 |
|
3879 |
13 Mar 20 |
peter |
60 |
void test1(test::Suite& suite) |
3879 |
13 Mar 20 |
peter |
61 |
{ |
3879 |
13 Mar 20 |
peter |
62 |
const omic::BamRead read; |
3879 |
13 Mar 20 |
peter |
63 |
const omic::BamPair pair(read, read); |
3879 |
13 Mar 20 |
peter |
// using empty constructor above so avoid running tests below |
3879 |
13 Mar 20 |
peter |
65 |
if (false) { |
3879 |
13 Mar 20 |
peter |
66 |
omic::BamPair other(pair); |
3879 |
13 Mar 20 |
peter |
67 |
other = pair; |
3879 |
13 Mar 20 |
peter |
68 |
other.first() = pair.first(); |
3879 |
13 Mar 20 |
peter |
69 |
other.second() = pair.second(); |
3879 |
13 Mar 20 |
peter |
70 |
|
3879 |
13 Mar 20 |
peter |
71 |
other = func_pair(read); |
3879 |
13 Mar 20 |
peter |
72 |
other = func_proxy(read); |
3879 |
13 Mar 20 |
peter |
73 |
} |
3879 |
13 Mar 20 |
peter |
74 |
} |
3879 |
13 Mar 20 |
peter |
75 |
#endif |