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

daisytuner / sdfglib / 17576881200

09 Sep 2025 08:38AM UTC coverage: 61.126% (+2.0%) from 59.145%
17576881200

Pull #219

github

web-flow
Merge 51d6d85aa into b8fdeb232
Pull Request #219: stdlib Library Nodes and ConstantNodes

424 of 1350 new or added lines in 74 files covered. (31.41%)

90 existing lines in 32 files now uncovered.

9307 of 15226 relevant lines covered (61.13%)

109.07 hits per line

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

0.0
/src/data_flow/library_nodes/stdlib/fputc.cpp
1
#include "sdfg/data_flow/library_nodes/stdlib/fputc.h"
2

3
namespace sdfg {
4
namespace stdlib {
5

NEW
6
FPutcNode::FPutcNode(
×
7
    size_t element_id, const DebugInfo& debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph& parent
8
)
NEW
9
    : LibraryNode(
×
NEW
10
          element_id,
×
NEW
11
          debug_info,
×
NEW
12
          vertex,
×
NEW
13
          parent,
×
14
          LibraryNodeType_FPutc,
NEW
15
          {"_ret", "_stream"},
×
NEW
16
          {"_character", "_stream"},
×
17
          true,
18
          data_flow::ImplementationType_NONE
NEW
19
      ) {}
×
20

NEW
21
void FPutcNode::validate(const Function& function) const {}
×
22

NEW
23
symbolic::SymbolSet FPutcNode::symbols() const { return {}; }
×
24

25
std::unique_ptr<data_flow::DataFlowNode> FPutcNode::
NEW
26
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
NEW
27
    return std::make_unique<FPutcNode>(element_id, debug_info_, vertex, parent);
×
28
}
29

NEW
30
void FPutcNode::replace(const symbolic::Expression& old_expression, const symbolic::Expression& new_expression) {}
×
31

NEW
32
nlohmann::json FPutcNodeSerializer::serialize(const data_flow::LibraryNode& library_node) {
×
NEW
33
    const FPutcNode& node = static_cast<const FPutcNode&>(library_node);
×
34

NEW
35
    nlohmann::json j;
×
NEW
36
    j["code"] = node.code().value();
×
37

NEW
38
    return j;
×
NEW
39
}
×
40

NEW
41
data_flow::LibraryNode& FPutcNodeSerializer::deserialize(
×
42
    const nlohmann::json& j, builder::StructuredSDFGBuilder& builder, structured_control_flow::Block& parent
43
) {
NEW
44
    assert(j.contains("code"));
×
NEW
45
    assert(j.contains("debug_info"));
×
46

NEW
47
    auto code = j["code"].get<std::string>();
×
NEW
48
    if (code != LibraryNodeType_FPutc.value()) {
×
NEW
49
        throw InvalidSDFGException("Invalid library node code");
×
50
    }
51

NEW
52
    sdfg::serializer::JSONSerializer serializer;
×
NEW
53
    DebugInfo debug_info = serializer.json_to_debug_info(j["debug_info"]);
×
54

NEW
55
    return builder.add_library_node<FPutcNode>(parent, debug_info);
×
NEW
56
}
×
57

NEW
58
FPutcNodeDispatcher::FPutcNodeDispatcher(
×
59
    codegen::LanguageExtension& language_extension,
60
    const Function& function,
61
    const data_flow::DataFlowGraph& data_flow_graph,
62
    const FPutcNode& node
63
)
NEW
64
    : codegen::LibraryNodeDispatcher(language_extension, function, data_flow_graph, node) {}
×
65

NEW
66
void FPutcNodeDispatcher::dispatch_code(
×
67
    codegen::PrettyPrinter& stream,
68
    codegen::PrettyPrinter& globals_stream,
69
    codegen::CodeSnippetFactory& library_snippet_factory
70
) {
NEW
71
    auto& fputc_node = static_cast<const FPutcNode&>(node_);
×
72

NEW
73
    stream << fputc_node.outputs().at(0);
×
NEW
74
    stream << " = ";
×
NEW
75
    stream << "fputc(";
×
NEW
76
    stream << fputc_node.inputs().at(0) << ", ";
×
NEW
77
    stream << fputc_node.inputs().at(1) << ");";
×
NEW
78
    stream << std::endl;
×
NEW
79
}
×
80

81
} // namespace stdlib
82
} // 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