GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: src/RGB.cpp Lines: 10 10 100.0 %
Date: 2022-10-11 07:18:13 Branches: 6 6 100.0 %

Line Branch Exec Source
1
#include "RGB.hpp"
2
3
namespace blink1_lib {
4
115
    RGB::RGB(const std::uint8_t _r, const std::uint8_t _g, const std::uint8_t _b) noexcept : r(_r), g(_g), b(_b) {}
5
6
14
    bool RGB::operator==(const RGB& other) const noexcept {
7

14
        return r == other.r && g == other.g && b == other.b;
8
    }
9
10
3
    bool RGB::operator!=(const RGB& other) const noexcept {
11
3
        return !(*this == other);
12
    }
13
14
2
    std::ostream& operator<<(std::ostream& os, const RGB& rgb) {
15
2
        os << "RGB{r=" << static_cast<unsigned>(rgb.r)
16
2
            << ", g=" << static_cast<unsigned>(rgb.g)
17
2
            << ", b=" << static_cast<unsigned>(rgb.b) << "}";
18
2
        return os;
19
    }
20
}