This repository was archived by the owner on Oct 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathSVLocusSetSerializeTest.cpp
More file actions
96 lines (72 loc) · 2.43 KB
/
SVLocusSetSerializeTest.cpp
File metadata and controls
96 lines (72 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//
// Manta - Structural Variant and Indel Caller
// Copyright (c) 2013-2025 Illumina, Inc.
//
// This program is licensed under the terms of the Polyform strict license
//
// ***As far as the law allows, the software comes as is, without
// any warranty or condition, and the licensor will not be liable
// to you for any damages arising out of these terms or the use
// or nature of the software, under any kind of legal claim.***
//
// You should have received a copy of the PolyForm Strict License 1.0.0
// along with this program. If not, see <https://polyformproject.org/licenses/strict/1.0.0>.
//
//
#include "boost/test/unit_test.hpp"
#include "svgraph/SVLocusSet.hpp"
#include "test/testSVLocusSetUtil.hpp"
#include "test/testSVLocusUtil.hpp"
BOOST_AUTO_TEST_SUITE(SVLocusSetSerialize_test_suite)
BOOST_AUTO_TEST_CASE(test_SVLocusSetSerialize)
{
// construct a simple two-node locus
SVLocus locus1;
locusAddPair(locus1, 1, 10, 20, 2, 30, 40);
SVLocus locus2;
locusAddPair(locus2, 3, 10, 20, 4, 30, 40);
SVLocusSet set1;
set1.merge(locus1);
set1.merge(locus2);
const auto set1_copy_ptr(getSerializedSVLocusSetCopy(set1));
BOOST_REQUIRE_EQUAL(set1.size(), set1_copy_ptr->size());
typedef SVLocusSet::const_iterator citer;
citer i(set1.begin());
citer i_copy(set1_copy_ptr->begin());
const SVLocus& set1_locus1(*i);
const SVLocus& set1_copy_locus1(*i_copy);
BOOST_REQUIRE_EQUAL(set1_locus1.size(), set1_copy_locus1.size());
}
BOOST_AUTO_TEST_CASE(test_SVLocusSetSerialize2)
{
SVLocusSet set1;
{
SVLocus locus1;
locusAddPair(locus1, 1, 10, 20, 2, 30, 40);
SVLocus locus2;
locusAddPair(locus2, 3, 10, 20, 4, 30, 40);
set1.merge(locus1);
set1.merge(locus2);
}
SVLocusSet set2;
{
SVLocus locus1;
locusAddPair(locus1, 1, 15, 25, 4, 30, 40);
SVLocus locus2;
locusAddPair(locus2, 3, 30, 40, 2, 30, 40);
set2.merge(locus1);
set2.merge(locus2);
}
const auto set1_copy_ptr(getSerializedSVLocusSetCopy(set1));
const auto set2_copy_ptr(getSerializedSVLocusSetCopy(set2));
set1.merge(set2);
set1_copy_ptr->merge(*set2_copy_ptr);
BOOST_REQUIRE_EQUAL(set1.size(), set1_copy_ptr->size());
typedef SVLocusSet::const_iterator citer;
citer i(set1.begin());
citer i_copy(set1_copy_ptr->begin());
const SVLocus& set1_locus1(*i);
const SVLocus& set1_copy_locus1(*i_copy);
BOOST_REQUIRE_EQUAL(set1_locus1.size(), set1_copy_locus1.size());
}
BOOST_AUTO_TEST_SUITE_END()