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

bcpearce / hass-motion-detection-addon / 21126887229

19 Jan 2026 05:54AM UTC coverage: 17.99% (-32.0%) from 49.971%
21126887229

Pull #26

github

web-flow
Merge c98d1d60e into 0206cb867
Pull Request #26: Additional test coverage

292 of 1865 branches covered (15.66%)

Branch coverage included in aggregate %.

8 of 22 new or added lines in 3 files covered. (36.36%)

827 existing lines in 29 files now uncovered.

347 of 1687 relevant lines covered (20.57%)

28.54 hits per line

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

0.0
/include/Util/CurlWrapper.h
1
#pragma once
2

3
#include <array>
4
#include <exception>
5
#include <format>
6
#include <string_view>
7
#include <utility>
8

9
#include <curl/curl.h>
10

11
namespace util {
12

13
class CurlWrapper {
14
public:
15
  class CurlError : public std::runtime_error {
16
  public:
17
    using std::runtime_error::runtime_error;
18
  };
19

20
  CurlWrapper() noexcept;
21
  CurlWrapper(const CurlWrapper &) = delete;
22
  CurlWrapper &operator=(const CurlWrapper &) = delete;
23
  CurlWrapper(CurlWrapper &&) noexcept;
24
  CurlWrapper &operator=(CurlWrapper &&) noexcept;
25

26
  ~CurlWrapper() noexcept;
27
  CURL *pCurl_{nullptr};
UNCOV
28
  CURL *operator&() { return pCurl_; }
×
UNCOV
29
  operator bool() const { return bool(pCurl_); }
×
30

UNCOV
31
  template <typename F, typename... Ts> CURLcode call(F func, Ts... args) {
×
UNCOV
32
    const CURLcode res = func(pCurl_, args...);
×
UNCOV
33
    if (res != CURLcode::CURLE_OK) {
×
34
      throw CurlError(
×
35
          std::format("Error {} calling CURL function {}: {}", int(res),
×
36
                      typeid(func).name(),
×
37
                      std::string_view(errBuf_.data(), errBuf_.size())));
×
38
    }
UNCOV
39
    return res;
×
40
  }
41

42
  template <typename F, typename... Ts>
UNCOV
43
  inline CURLcode operator()(F func, Ts... args) {
×
UNCOV
44
    return this->call(func, args...);
×
45
  }
46

47
private:
48
  std::array<char, CURL_ERROR_SIZE> errBuf_;
49
};
50

51
} // namespace util
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