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

blues / note-arduino / 13523375661

25 Feb 2025 02:18PM CUT coverage: 90.526% (-4.3%) from 94.831%
13523375661

Pull #132

github

web-flow
Merge 94f998ff5 into 2efe3032e
Pull Request #132: WIP: Template Singleton `make_` functions

98 of 137 branches covered (71.53%)

Branch coverage included in aggregate %.

28 of 33 new or added lines in 3 files covered. (84.85%)

1 existing line in 1 file now uncovered.

332 of 338 relevant lines covered (98.22%)

15.22 hits per line

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

92.31
/src/NoteLog_Arduino.cpp
1
#include "NoteLog_Arduino.hpp"
2

3
// Singleton instance of the NoteLog_Arduino class
4
namespace instance {
5
    inline NoteLog* & note_log (void) {
7✔
6
        static NoteLog* note_log = nullptr;
7
        return note_log;
7✔
8
    }
9
};
10

11
NoteLog *
12
make_note_log (
3✔
13
    nullptr_t
14
) {
15
    NoteLog* & note_log = instance::note_log();
3✔
16
    if (note_log) {
3!
17
        delete note_log;
3!
18
        note_log = nullptr;
3✔
19
    }
20
    return note_log;
3✔
21
}
22

23
template <typename T>
24
NoteLog *
25
make_note_log (
4✔
26
    T & log_parameters_
27
) {
28
    NoteLog* & note_log = instance::note_log();
4✔
29
    if (!note_log) {
4✔
30
        note_log = new NoteLog_Arduino(reinterpret_cast<T *>(&log_parameters_));
3✔
31
    }
32

33
    return note_log;
4✔
34
}
35

36
NoteLog_Arduino::NoteLog_Arduino
5✔
37
(
38
    Stream * log_stream_
39
) :
5✔
40
    _notecardLog(log_stream_)
5✔
41
{ }
5✔
42

43
size_t
44
NoteLog_Arduino::print (
2✔
45
    const char * str_
46
)
47
{
48
    size_t result;
49

50
    result = _notecardLog->print(str_);
2✔
51

52
    return result;
2✔
53
}
54

55
// Explicitly instantiate the template function for the supported types
56
template NoteLog * make_note_log<Stream>(Stream &);
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

© 2025 Coveralls, Inc