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

Alan-Jowett / ebpf-verifier / 15194704016

22 May 2025 08:53AM UTC coverage: 88.11% (-0.07%) from 88.177%
15194704016

push

github

elazarg
uniform class names and explicit constructors for adapt_sgraph.hpp

Signed-off-by: Elazar Gershuni <elazarg@gmail.com>

27 of 30 new or added lines in 1 file covered. (90.0%)

481 existing lines in 33 files now uncovered.

8552 of 9706 relevant lines covered (88.11%)

9089054.61 hits per line

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

83.33
/src/string_constraints.hpp
1
// Copyright (c) Prevail Verifier contributors.
2
// SPDX-License-Identifier: MIT
3

4
#pragma once
5

6
#include <regex>
7
#include <set>
8
#include <string>
9
#include <vector>
10

11
#include "crab/interval.hpp"
12
#include "crab/linear_constraint.hpp"
13

14
namespace prevail {
15
struct StringInvariant {
2,294✔
16
    std::optional<std::set<std::string>> maybe_inv{};
17

18
    StringInvariant() = default;
198✔
19

20
    explicit StringInvariant(std::set<std::string> inv) : maybe_inv(std::move(inv)) {}
5,924✔
21

22
    StringInvariant(const StringInvariant& inv) = default;
8,065✔
23
    StringInvariant& operator=(const StringInvariant& inv) = default;
114✔
24

25
    [[nodiscard]]
26
    bool is_bottom() const {
5,454✔
27
        return !maybe_inv;
5,454✔
28
    }
29
    [[nodiscard]]
30
    bool empty() const {
×
UNCOV
31
        return maybe_inv && maybe_inv->empty();
×
32
    }
33

34
    static StringInvariant top() { return StringInvariant{{}}; }
1,728✔
35
    static StringInvariant bottom() { return StringInvariant{}; }
198✔
36

37
    [[nodiscard]]
38
    const std::set<std::string>& value() const {
3,108✔
39
        if (is_bottom()) {
3,108✔
UNCOV
40
            throw std::runtime_error("cannot iterate bottom");
×
41
        }
42
        return *maybe_inv;
3,108✔
43
    }
44

45
    StringInvariant operator-(const StringInvariant& b) const;
46
    StringInvariant operator+(const StringInvariant& b) const;
47

48
    bool operator==(const StringInvariant& other) const { return maybe_inv == other.maybe_inv; }
1,404✔
49

50
    [[nodiscard]]
51
    bool contains(const std::string& item) const {
874✔
52
        return maybe_inv.value().contains(item);
874✔
53
    }
54

55
    friend std::ostream& operator<<(std::ostream&, const StringInvariant& inv);
56
};
57

58
std::vector<LinearConstraint> parse_linear_constraints(const std::set<std::string>& constraints,
59
                                                       std::vector<Interval>& numeric_ranges);
60
} // namespace prevail
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