• 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

73.68
/src/structured_control_flow/sequence.cpp
1
#include "sdfg/structured_control_flow/sequence.h"
2

3
namespace sdfg {
4
namespace structured_control_flow {
5

6
Transition::Transition(size_t element_id, const DebugInfo& debug_info)
86✔
7
    : Element(element_id, debug_info) {
43✔
8

9
      };
43✔
10

11
Transition::Transition(size_t element_id, const DebugInfo& debug_info,
768✔
12
                       const symbolic::Assignments& assignments)
13
    : Element(element_id, debug_info), assignments_(assignments) {
768✔
14

15
      };
768✔
16

17
const symbolic::Assignments& Transition::assignments() const { return this->assignments_; };
31✔
18

19
symbolic::Assignments& Transition::assignments() { return this->assignments_; };
1,731✔
20

21
bool Transition::empty() const { return this->assignments_.empty(); };
54✔
22

23
size_t Transition::size() const { return this->assignments_.size(); };
43✔
24

25
void Transition::replace(const symbolic::Expression& old_expression,
×
26
                         const symbolic::Expression& new_expression) {
27

28
};
×
29

30
Sequence::Sequence(size_t element_id, const DebugInfo& debug_info)
1,496✔
31
    : ControlFlowNode(element_id, debug_info) {
748✔
32

33
      };
748✔
34

35
size_t Sequence::size() const { return this->children_.size(); };
2,905✔
36

37
std::pair<const ControlFlowNode&, const Transition&> Sequence::at(size_t i) const {
228✔
38
    return {*this->children_.at(i), *this->transitions_.at(i)};
228✔
39
};
40

41
std::pair<ControlFlowNode&, Transition&> Sequence::at(size_t i) {
1,602✔
42
    return {*this->children_.at(i), *this->transitions_.at(i)};
1,602✔
43
};
44

45
void Sequence::replace(const symbolic::Expression& old_expression,
117✔
46
                       const symbolic::Expression& new_expression) {
47
    for (auto& child : this->children_) {
171✔
48
        child->replace(old_expression, new_expression);
54✔
49
    }
50

51
    if (SymEngine::is_a<SymEngine::Symbol>(*old_expression)) {
117✔
52
        auto old_symbol = SymEngine::rcp_static_cast<const SymEngine::Symbol>(old_expression);
117✔
53

54
        for (auto& trans : this->transitions_) {
171✔
55
            if (trans->assignments().find(old_symbol) != trans->assignments().end()) {
54✔
NEW
56
                if (!SymEngine::is_a<SymEngine::Symbol>(*new_expression)) {
×
NEW
57
                    throw InvalidSDFGException(
×
NEW
58
                        "Sequence: Assigments do not support complex expressions on LHS");
×
59
                }
60
                auto new_symbol =
61
                    SymEngine::rcp_static_cast<const SymEngine::Symbol>(new_expression);
×
62
                trans->assignments()[new_symbol] = trans->assignments()[old_symbol];
×
63
                trans->assignments().erase(old_symbol);
×
64
            }
×
65

66
            for (auto& entry : trans->assignments()) {
54✔
67
                entry.second = symbolic::subs(entry.second, old_expression, new_expression);
×
68
            }
69
        }
70
    }
117✔
71
};
117✔
72

73
}  // namespace structured_control_flow
74
}  // 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