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

Line Branch Exec Source
1
#include "PatternLine.hpp"
2
3
namespace blink1_lib {
4
1
    PatternLine::PatternLine(const RGB& _rgb, const std::uint16_t _fadeMillis) noexcept : fadeMillis(_fadeMillis), rgb(_rgb) {}
5
12
    PatternLine::PatternLine(const std::uint8_t _r, const std::uint8_t _g, const std::uint8_t _b, const std::uint16_t _fadeMillis) noexcept
6
12
        : fadeMillis(_fadeMillis), rgb(_r, _g, _b) {}
7
8
6
    bool PatternLine::operator==(const PatternLine& other) const noexcept {
9

6
        return fadeMillis == other.fadeMillis && rgb == other.rgb;
10
    }
11
12
4
    bool PatternLine::operator!=(const PatternLine& other) const noexcept {
13
4
        return !(*this == other);
14
    }
15
16
1
    std::ostream& operator<<(std::ostream& os, const PatternLine& patternLine) {
17
1
        os << "PatternLine{rgb=" << patternLine.rgb << ", fadeMillis=" << static_cast<unsigned>(patternLine.fadeMillis) << "}";
18
1
        return os;
19
    }
20
}