• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MikkelSchubert / adapterremoval / #75

24 Mar 2025 09:26PM UTC coverage: 27.778% (+0.7%) from 27.088%
#75

push

travis-ci

web-flow
rework debug serialization (#97)

- Patch catch2 to disable the built-in stringification of objects with
  begin()/end() functions, to prevent complex objects from being mangled
- Specify custom fallbackStringifier function, that uses a StringStream.
  This ensures that support for stringification is present when tests are
  written, rather than objects being emitted as "{?}"
- Replace existing StringMaker implementations with operator<< functions
- Add tests for these functions

91 of 103 new or added lines in 8 files covered. (88.35%)

11 existing lines in 3 files now uncovered.

2687 of 9673 relevant lines covered (27.78%)

4228.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.48
/src/sequence.cpp
1
// SPDX-License-Identifier: GPL-3.0-or-later
2
// SPDX-FileCopyrightText: 2024 Mikkel Schubert <mikkelsch@gmail.com>
3
#include "sequence.hpp"  // declarations
4
#include "fastq_enc.hpp" // for FASTQ_ENCODING_33
5
#include "strutils.hpp"  // for log_escape
6
#include <array>         // for array
7

8
namespace adapterremoval {
9

10
dna_sequence::dna_sequence(std::string seq)
394✔
11
  : m_sequence(std::move(seq))
394✔
12
{
13
  FASTQ_ENCODING_SAM.process_nucleotides(m_sequence);
394✔
14
}
394✔
15

16
dna_sequence
17
dna_sequence::operator+(const dna_sequence& other) const
2✔
18
{
19
  dna_sequence result;
2✔
20
  result.m_sequence.reserve(length() + other.length());
6✔
21
  result.m_sequence += m_sequence;
2✔
22
  result.m_sequence += other.m_sequence;
2✔
23

24
  return result;
2✔
NEW
25
}
×
26

27
dna_sequence
28
dna_sequence::reverse_complement() const
128✔
29
{
30
  // Lookup table for complementary bases based only on the last 4 bits
31
  static constexpr std::array<char, 16> complements{ '-', 'T', '-', 'G',
128✔
32
                                                     'A', '-', '-', 'C',
33
                                                     '-', '-', '-', '-',
34
                                                     '-', '-', 'N', '-' };
35

36
  dna_sequence rc;
128✔
37
  rc.m_sequence.reserve(length());
256✔
38
  for (auto it = m_sequence.rbegin(); it != m_sequence.rend(); ++it) {
1,512✔
39
    rc.m_sequence.push_back(complements[*it & 0xf]);
750✔
40
  }
41

42
  return rc;
128✔
NEW
43
}
×
44

45
std::ostream&
46
operator<<(std::ostream& os, const dna_sequence& value)
2✔
47
{
48
  return os << "dna_sequence{" << log_escape(value) << "}";
8✔
49
}
50

51
} // namespace adapterremoval
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc