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

daisytuner / sdfglib / 15238257521

25 May 2025 01:14PM UTC coverage: 60.342% (-0.1%) from 60.473%
15238257521

push

github

web-flow
Merge pull request #31 from daisytuner/exception-handling

Exception handling

18 of 60 new or added lines in 17 files covered. (30.0%)

1 existing line in 1 file now uncovered.

8052 of 13344 relevant lines covered (60.34%)

102.27 hits per line

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

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

3
namespace sdfg {
4

5
DebugInfo::DebugInfo()
2,937✔
6
    : filename_(),
2,937✔
7
      start_line_(0),
2,937✔
8
      start_column_(0),
2,937✔
9
      end_line_(0),
2,937✔
10
      end_column_(0),
2,937✔
11
      has_(false) {
2,937✔
12

13
      };
2,937✔
14

15
DebugInfo::DebugInfo(std::string filename, size_t start_line, size_t start_column, size_t end_line,
15✔
16
                     size_t end_column)
17
    : filename_(filename),
15✔
18
      start_line_(start_line),
15✔
19
      start_column_(start_column),
15✔
20
      end_line_(end_line),
15✔
21
      end_column_(end_column),
15✔
22
      has_(true) {
15✔
23

24
      };
15✔
25

26
bool DebugInfo::has() const { return this->has_; };
45✔
27

28
std::string DebugInfo::filename() const { return this->filename_; };
34✔
29

30
size_t DebugInfo::start_line() const { return this->start_line_; };
7✔
31

32
size_t DebugInfo::start_column() const { return this->start_column_; };
7✔
33

34
size_t DebugInfo::end_line() const { return this->end_line_; };
7✔
35

36
size_t DebugInfo::end_column() const { return this->end_column_; };
7✔
37

38
DebugInfo DebugInfo::merge(const DebugInfo& left, const DebugInfo& right) {
30✔
39
    if (!left.has()) {
30✔
40
        return right;
22✔
41
    }
42
    if (!right.has()) {
8✔
43
        return left;
1✔
44
    }
45
    if (left.filename() != right.filename()) {
7✔
NEW
46
        throw InvalidSDFGException("DebugInfo: Filenames do not match");
×
47
    }
48

49
    size_t start_line = 0;
7✔
50
    size_t start_column = 0;
7✔
51
    size_t end_line = 0;
7✔
52
    size_t end_column = 0;
7✔
53

54
    if (left.start_line_ < right.start_line_) {
7✔
55
        start_line = left.start_line_;
1✔
56
        start_column = left.start_column_;
1✔
57
    } else {
1✔
58
        start_line = right.start_line_;
6✔
59
        start_column = right.start_column_;
6✔
60
    }
61

62
    if (left.end_line_ > right.end_line_) {
7✔
63
        end_line = left.end_line_;
1✔
64
        end_column = left.end_column_;
1✔
65
    } else {
1✔
66
        end_line = right.end_line_;
6✔
67
        end_column = right.end_column_;
6✔
68
    }
69
    return DebugInfo(left.filename_, start_line, start_column, end_line, end_column);
7✔
70
};
30✔
71

72
Element::Element(size_t element_id, const DebugInfo& debug_info)
4,036✔
73
    : element_id_(element_id),
4,036✔
74
      debug_info_(debug_info){
8,072✔
75

76
      };
4,036✔
77

78
size_t Element::element_id() const { return this->element_id_; };
2,414✔
79

80
std::string Element::name() const {
1,693✔
81
    std::string name = std::to_string(this->element_id());
1,693✔
82
    std::replace(name.begin(), name.end(), '-', '_');
1,693✔
83
    return "__element_" + name;
1,693✔
84
};
1,693✔
85

86
const DebugInfo& Element::debug_info() const { return this->debug_info_; };
113✔
87

88
}  // 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