GCC Code Coverage Report


Directory: ./
File: src/Transmission.cpp
Date: 2025-02-27 10:29:23
Exec Total Coverage
Lines: 4 16 25.0%
Branches: 1 12 8.3%

Line Branch Exec Source
1 /*****************************************************************************
2 *
3 * Copyright (C) 2022 Florian Pose <fp@igh.de>
4 *
5 * This file is part of the QtPdCom library.
6 *
7 * The QtPdCom library is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * The QtPdCom library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 * License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with the QtPdCom Library. If not, see <http://www.gnu.org/licenses/>.
19 *
20 ****************************************************************************/
21
22 #include "Transmission.h"
23
24 #include <QString>
25
26 #include <sstream>
27
28 using namespace QtPdCom;
29
30 /****************************************************************************/
31
32 6 PdCom::Transmission Transmission::toPdCom() const
33 {
34
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
6 switch (mode_) {
35 case Poll:
36 case ManualPoll:
37 default:
38 return { PdCom::poll_mode };
39 6 case Event:
40 6 return { PdCom::event_mode };
41 case Continuous:
42 return { std::chrono::duration<double>(interval_) };
43 }
44 }
45
46 /****************************************************************************/
47
48 QString Transmission::toString() const
49 {
50 switch (mode_) {
51 case Poll:
52 default:
53 return QString("poll(%1)").arg(interval_);
54 case Event:
55 return QString("event");
56 case Continuous:
57 return QString("cont(%1)").arg(interval_);
58 }
59 }
60
61 /****************************************************************************/
62