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

daisytuner / sdfglib / 16935824775

13 Aug 2025 11:26AM UTC coverage: 65.597%. Remained the same
16935824775

push

github

web-flow
Merge pull request #196 from daisytuner/graceful-merge-dbg

handles failure of dbg merge gracefully

0 of 1 new or added line in 1 file covered. (0.0%)

9196 of 14019 relevant lines covered (65.6%)

128.22 hits per line

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

97.62
/src/element.cpp
1
#include "sdfg/element.h"
2

3
namespace sdfg {
4

5
DebugInfo::DebugInfo()
2,974✔
6
    : filename_(), start_line_(0), start_column_(0), end_line_(0), end_column_(0), has_(false) {
2,974✔
7

8
      };
2,974✔
9

10
DebugInfo::DebugInfo(std::string filename, size_t start_line, size_t start_column, size_t end_line, size_t end_column)
13✔
11
    : filename_(filename), start_line_(start_line), start_column_(start_column), end_line_(end_line),
13✔
12
      end_column_(end_column), has_(true) {
13✔
13

14
      };
13✔
15

16
bool DebugInfo::has() const { return this->has_; };
155✔
17

18
std::string DebugInfo::filename() const { return this->filename_; };
127✔
19

20
size_t DebugInfo::start_line() const { return this->start_line_; };
121✔
21

22
size_t DebugInfo::start_column() const { return this->start_column_; };
121✔
23

24
size_t DebugInfo::end_line() const { return this->end_line_; };
121✔
25

26
size_t DebugInfo::end_column() const { return this->end_column_; };
121✔
27

28
DebugInfo DebugInfo::merge(const DebugInfo& left, const DebugInfo& right) {
24✔
29
    if (!left.has()) {
24✔
30
        return right;
14✔
31
    }
32
    if (!right.has()) {
10✔
33
        return left;
7✔
34
    }
35
    if (left.filename() != right.filename()) {
3✔
NEW
36
        return left;
×
37
    }
38

39
    size_t start_line = 0;
3✔
40
    size_t start_column = 0;
3✔
41
    size_t end_line = 0;
3✔
42
    size_t end_column = 0;
3✔
43

44
    if (left.start_line_ < right.start_line_) {
3✔
45
        start_line = left.start_line_;
1✔
46
        start_column = left.start_column_;
1✔
47
    } else {
1✔
48
        start_line = right.start_line_;
2✔
49
        start_column = right.start_column_;
2✔
50
    }
51

52
    if (left.end_line_ > right.end_line_) {
3✔
53
        end_line = left.end_line_;
2✔
54
        end_column = left.end_column_;
2✔
55
    } else {
2✔
56
        end_line = right.end_line_;
1✔
57
        end_column = right.end_column_;
1✔
58
    }
59
    return DebugInfo(left.filename_, start_line, start_column, end_line, end_column);
3✔
60
};
24✔
61

62
Element::Element(size_t element_id, const DebugInfo& debug_info) : element_id_(element_id), debug_info_(debug_info) {};
4,338✔
63

64
size_t Element::element_id() const { return this->element_id_; };
2,077✔
65

66
const DebugInfo& Element::debug_info() const { return this->debug_info_; };
380✔
67

68
void Element::set_debug_info(const DebugInfo& debug_info) { this->debug_info_ = debug_info; };
4✔
69

70
} // namespace sdfg
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