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

daisytuner / sdfglib / 15120496827

19 May 2025 06:29PM UTC coverage: 63.542% (-0.07%) from 63.608%
15120496827

push

github

web-flow
Merge pull request #21 from daisytuner/errors

adds invalid sdfg exception

5 of 14 new or added lines in 3 files covered. (35.71%)

7 existing lines in 2 files now uncovered.

8650 of 13613 relevant lines covered (63.54%)

481.54 hits per line

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

69.39
/src/function.cpp
1
#include "sdfg/function.h"
2

3
using json = nlohmann::json;
4

5
namespace sdfg {
6

7
Function::Function(const std::string& name)
1,106✔
8
    : name_(name){
553✔
9

10
      };
553✔
11

12
std::string Function::name() const { return this->name_; };
748✔
13

14
bool Function::exists(const std::string& name) const {
83✔
15
    return this->containers_.find(name) != this->containers_.end() ||
136✔
16
           symbolic::is_pointer(symbolic::symbol(name));
53✔
17
};
×
18

19
const types::IType& Function::type(const std::string& name) const {
2,160✔
20
    auto entry = this->containers_.find(name);
2,160✔
21
    if (entry == this->containers_.end()) {
2,160✔
NEW
22
        throw InvalidSDFGException("Container does not exist in SDFG");
×
23
    }
24
    return *entry->second;
2,160✔
UNCOV
25
};
×
26

27
const types::StructureDefinition& Function::structure(const std::string& name) const {
25✔
28
    auto entry = this->structures_.find(name);
25✔
29
    if (entry == this->structures_.end()) {
25✔
NEW
30
        throw InvalidSDFGException("Structure does not exist in SDFG");
×
31
    }
32
    return *entry->second;
25✔
UNCOV
33
};
×
34

35
const std::vector<std::string>& Function::arguments() const { return this->arguments_; };
17✔
36

37
const std::vector<std::string>& Function::externals() const { return this->externals_; };
22✔
38

39
bool Function::is_argument(const std::string& name) const {
13,266✔
40
    return std::find(this->arguments_.begin(), this->arguments_.end(), name) !=
26,532✔
41
           this->arguments_.end();
13,266✔
42
};
43

44
bool Function::is_external(const std::string& name) const {
9,729✔
45
    return std::find(this->externals_.begin(), this->externals_.end(), name) !=
19,458✔
46
           this->externals_.end();
9,729✔
47
};
48

49
bool Function::is_internal(const std::string& name) const {
9,897✔
50
    return helpers::endswith(name, external_suffix) &&
9,897✔
51
           is_external(name.substr(0, name.length() - external_suffix.length()));
×
52
};
×
53

54
bool Function::is_transient(const std::string& name) const {
13,250✔
55
    return !this->is_argument(name) && !this->is_external(name) && !this->is_internal(name);
13,250✔
56
};
57

58
bool Function::has_assumption(const symbolic::Symbol& symbol) const {
1✔
59
    return this->assumptions_.find(symbol) != this->assumptions_.end();
1✔
60
};
61

62
const symbolic::Assumption& Function::assumption(const symbolic::Symbol& symbol) const {
×
63
    auto entry = this->assumptions_.find(symbol);
×
NEW
64
    if (entry == this->assumptions_.end()) {
×
NEW
65
        throw InvalidSDFGException("Assumption does not exist in SDFG");
×
66
    }
UNCOV
67
    return entry->second;
×
UNCOV
68
};
×
69

70
symbolic::Assumption& Function::assumption(const symbolic::Symbol& symbol) {
1✔
71
    auto entry = this->assumptions_.find(symbol);
1✔
72
    if (entry == this->assumptions_.end()) {
1✔
NEW
73
        throw InvalidSDFGException("Assumption does not exist in SDFG");
×
74
    }
75
    return entry->second;
1✔
UNCOV
76
};
×
77

78
const symbolic::Assumptions& Function::assumptions() const { return this->assumptions_; };
134✔
79

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