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

wirenboard / wb-mqtt-db / 96

31 Jul 2026 10:43AM UTC coverage: 78.543% (-1.8%) from 80.337%
96

push

github

web-flow
Use exported vars instead of MAKEFLAGS for coverage options (#66)

938 of 1102 branches covered (85.12%)

1563 of 1990 relevant lines covered (78.54%)

13.11 hits per line

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

97.73
/src/storage.cpp
1
#include "storage.h"
2

3
TChannelName::TChannelName(const std::string& device, const std::string& control): Device(device), Control(control)
227✔
4
{}
227✔
5

6
bool TChannelName::operator==(const TChannelName& rhs) const
72✔
7
{
8
    return std::tie(this->Device, this->Control) == std::tie(rhs.Device, rhs.Control);
72✔
9
}
10

11
std::ostream& operator<<(std::ostream& out, const TChannelName& name)
141✔
12
{
13
    out << name.Device << "/" << name.Control;
141✔
14
    return out;
141✔
15
}
16

17
TChannelInfo::TChannelInfo(int64_t id, const std::string& device, const std::string& control)
44✔
18
    : Id(id),
44✔
19
      RecordCount(0),
44✔
20
      Name(device, control),
44✔
21
      Precision(0.0)
44✔
22
{}
44✔
23

24
const TChannelName& TChannelInfo::GetName() const
128✔
25
{
26
    return Name;
128✔
27
}
28

29
int32_t TChannelInfo::GetRecordCount() const
96✔
30
{
31
    return RecordCount;
96✔
32
}
33

34
const std::chrono::system_clock::time_point& TChannelInfo::GetLastRecordTime() const
4✔
35
{
36
    return LastRecordTime;
4✔
37
}
38

39
int64_t TChannelInfo::GetId() const
281✔
40
{
41
    return Id;
281✔
42
}
43

44
double TChannelInfo::GetPrecision() const
71✔
45
{
46
    return Precision;
71✔
47
}
48

49
PChannelInfo IStorage::CreateChannelPrivate(uint64_t id, const std::string& device, const std::string& control)
44✔
50
{
51
    PChannelInfo p(new TChannelInfo(id, device, control));
44✔
52
    Channels.emplace(TChannelName(device, control), p);
44✔
53
    return p;
44✔
54
}
×
55

56
void IStorage::SetRecordCount(TChannelInfo& channel, int recordCount)
82✔
57
{
58
    channel.RecordCount = (recordCount < 0) ? 0 : recordCount;
82✔
59
}
82✔
60

61
void IStorage::SetLastRecordTime(TChannelInfo& channel, const std::chrono::system_clock::time_point& time)
76✔
62
{
63
    channel.LastRecordTime = time;
76✔
64
}
76✔
65

66
void IStorage::SetPrecision(TChannelInfo& channel, double precision)
20✔
67
{
68
    channel.Precision = precision;
20✔
69
}
20✔
70

71
const std::unordered_map<TChannelName, PChannelInfo>& IStorage::GetChannelsPrivate() const
16✔
72
{
73
    return Channels;
16✔
74
}
75

76
PChannelInfo IStorage::FindChannel(const TChannelName& channelName) const
23✔
77
{
78
    auto it = Channels.find(channelName);
23✔
79
    if (it != Channels.end()) {
23✔
80
        return it->second;
21✔
81
    }
82
    return nullptr;
2✔
83
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc