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

wirenboard / wb-mqtt-serial / 1

20 Oct 2026 04:57AM UTC coverage: 86.817% (+14.0%) from 72.836%
1

Pull #1281

github

fab311
KraPete
Fix device model fallback in device/LoadConfig RPC

The short model register was never read because the extended register
error was converted to TRPCException. The RPC error now says that
the device model could not be read.
Pull Request #1281: Fix device model fallback in device/LoadConfig RPC

31180 of 80922 branches covered (38.53%)

74 of 76 new or added lines in 2 files covered. (97.37%)

1379 existing lines in 84 files now uncovered.

22464 of 25875 relevant lines covered (86.82%)

5205.91 hits per line

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

88.24
/src/json_common.cpp
1
#include "json_common.h"
2

3
Json::Value& MakeArray(const std::string& key, Json::Value& node)
14,580 ✔
4
{
5
    return (node[key] = Json::Value(Json::arrayValue));
14,580 !
6
}
7

8
Json::Value& Append(Json::Value& array)
8 ✔
9
{
10
    return array.append(Json::Value());
8 !
11
}
12

13
Json::Value MakeObject(const std::string& key, const std::string& value)
4,398 ✔
14
{
15
    Json::Value res;
4,398 ✔
16
    res[key] = value;
4,398 !
17
    return res;
4,398 ✔
UNCOV
18
}
×
19

20
Json::Value MakeSingleValueProperty(const std::string& value)
3,776 ✔
21
{
22
    Json::Value res;
3,776 ✔
23
    res["type"] = "string";
3,776 !
24
    MakeArray("enum", res).append(value);
3,776 !
25
    return res;
3,776 ✔
UNCOV
26
}
×
27

28
std::unordered_map<std::string, std::string> GetTranslations(const std::string& key, const Json::Value& schema)
18,960 ✔
29
{
30
    std::unordered_map<std::string, std::string> res;
18,960 ✔
31
    if (key.empty()) {
18,960 !
UNCOV
32
        return res;
×
33
    }
34
    if (schema.isMember("translations")) {
18,960 !
35
        const auto& translations = schema["translations"];
7,942 !
36
        for (Json::ValueConstIterator it = translations.begin(); it != translations.end(); ++it) {
17,856 !
37
            std::string tr = it->get(key, std::string()).asString();
9,914 !
38
            if (!tr.empty()) {
9,914 ✔
39
                res.emplace(it.name(), tr);
8,618 !
40
            }
41
        }
9,914 ✔
42
    }
43
    if (!res.count("en")) {
37,920 !
44
        res.emplace("en", key);
17,684 !
45
    }
46
    return res;
18,960 ✔
UNCOV
47
}
×
48

49
void AppendParams(Json::Value& dst, const Json::Value& src)
380 ✔
50
{
51
    for (auto it = src.begin(); it != src.end(); ++it) {
18,620 !
52
        dst[it.name()] = *it;
18,240 !
53
    }
54
}
380 ✔
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