GCC Code Coverage Report


Directory: src/
File: src/interpreter/midimessage.cpp
Date: 2022-05-10 08:17:32
Exec Total Coverage
Lines: 23 23 100.0%
Functions: 8 8 100.0%
Branches: 5 8 62.5%

Line Branch Exec Source
1 #include "midimessage.h"
2 #include "exceptions.h"
3
4 using namespace interpreter;
5
6 51 MidiMessage::MidiMessage(const QByteArray &message)
7 51 : m_message(message)
8 51 , m_length(message.size())
9 {
10
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 49 times.
51 if (m_length < 1)
11
3/6
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
6 UnexpectedMessage("No status byte in MIDI message").raise();
12
13 49 m_status = message.at(0);
14 49 m_op_code = (m_status & 0xf0) >> 4;
15 49 m_midi_channel = (m_status & 0x0f);
16 51 }
17
18 100 MidiMessage::~MidiMessage()
19 {
20 100 }
21
22 3 const QByteArray &MidiMessage::getMessage() const
23 {
24 3 return m_message;
25 }
26
27 3 size_t MidiMessage::getLength() const
28 {
29 3 return m_length;
30 }
31
32 3 uint8_t MidiMessage::getStatus() const
33 {
34 3 return m_status;
35 }
36
37 3 uint8_t MidiMessage::getOpcode() const
38 {
39 3 return m_op_code;
40 }
41
42 3 uint8_t MidiMessage::getMidiChannel() const
43 {
44 3 return m_midi_channel;
45 }
46
47 5 QString MidiMessage::toString() const
48 {
49 5 return "";
50 }
51