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

daisytuner / sdfglib / 17697974118

13 Sep 2025 02:36PM UTC coverage: 60.51% (+1.2%) from 59.335%
17697974118

Pull #219

github

web-flow
Merge a1c5ecbc6 into 6c1992b40
Pull Request #219: stdlib Library Nodes and ConstantNodes

565 of 1799 new or added lines in 102 files covered. (31.41%)

102 existing lines in 38 files now uncovered.

9442 of 15604 relevant lines covered (60.51%)

107.02 hits per line

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

70.97
/src/structured_control_flow/if_else.cpp
1
#include "sdfg/structured_control_flow/if_else.h"
2

3
#include "sdfg/symbolic/symbolic.h"
4

5
namespace sdfg {
6
namespace structured_control_flow {
7

8
IfElse::IfElse(size_t element_id, const DebugInfo& debug_info)
84✔
9
    : ControlFlowNode(element_id, debug_info) {
42✔
10

11
      };
42✔
12

13
void IfElse::validate(const Function& function) const {
49✔
14
    for (auto& entry : this->cases_) {
137✔
15
        entry->validate(function);
88✔
16
    }
17
    for (auto& entry : this->conditions_) {
137✔
18
        if (entry.is_null()) {
88✔
NEW
19
            throw InvalidSDFGException("IfElse: Conditions cannot be null");
×
20
        }
21
        if (!SymEngine::is_a_Boolean(*entry)) {
88✔
NEW
22
            throw InvalidSDFGException("IfElse: Conditions must be boolean expressions");
×
23
        }
24
    }
25
    if (this->cases_.size() != this->conditions_.size()) {
49✔
NEW
26
        throw InvalidSDFGException("IfElse: Number of cases must be equal to number of conditions");
×
27
    }
28
};
49✔
29

30
size_t IfElse::size() const { return this->cases_.size(); };
683✔
31

32
std::pair<const Sequence&, const symbolic::Condition> IfElse::at(size_t i) const {
24✔
33
    return {*this->cases_.at(i), this->conditions_.at(i)};
24✔
34
};
35

36
std::pair<Sequence&, const symbolic::Condition> IfElse::at(size_t i) {
385✔
37
    return {*this->cases_.at(i), this->conditions_.at(i)};
385✔
38
};
39

40
bool IfElse::is_complete() const {
49✔
41
    auto condition = symbolic::__false__();
49✔
42
    for (auto& entry : this->conditions_) {
130✔
43
        condition = symbolic::Or(condition, entry);
81✔
44
    }
45
    return symbolic::is_true(condition);
49✔
46
};
49✔
47

NEW
48
void IfElse::replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
×
49
    for (size_t i = 0; i < this->cases_.size(); ++i) {
×
50
        this->cases_.at(i)->replace(old_expression, new_expression);
×
51
        this->conditions_.at(i) = symbolic::subs(this->conditions_.at(i), old_expression, new_expression);
×
52
    }
×
53
};
×
54

55
} // namespace structured_control_flow
56
} // 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