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

ossia / score / 31952604910

16 Aug 2026 02:24PM UTC coverage: 19.438% (+3.2%) from 16.231%
31952604910

push

github

jcelerier
execution: fix a crash that has been lurking since 2018 in execution cleanup

0 of 1 new or added line in 1 file covered. (0.0%)

2699 existing lines in 72 files now uncovered.

41088 of 211385 relevant lines covered (19.44%)

4325.7 hits per line

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

81.58
/src/plugins/score-lib-process/Process/ProcessModelSerialization.cpp
1
// This is an open source non-commercial project. Dear PVS-Studio, please check
2
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
3
#include <Process/Process.hpp>
4
#include <Process/ProcessFactory.hpp>
5
#include <Process/ProcessList.hpp>
6
#include <Process/ProcessMimeSerialization.hpp>
7
#include <Process/TimeValue.hpp>
8
#include <Process/TimeValueSerialization.hpp>
9

10
#include <score/model/ModelMetadata.hpp>
11
#include <score/plugins/InterfaceList.hpp>
12
#include <score/plugins/StringFactoryKey.hpp>
13
#include <score/plugins/StringFactoryKeySerialization.hpp>
14
#include <score/serialization/DataStreamVisitor.hpp>
15
#include <score/serialization/JSONValueVisitor.hpp>
16
#include <score/serialization/JSONVisitor.hpp>
17

18
template <>
19
SCORE_LIB_PROCESS_EXPORT void DataStreamReader::read(const Process::ProcessData& process)
×
20
{
21
  m_stream << process.key << process.prettyName << process.customData;
×
22
}
×
23

24
// We only load the members of the process here.
25
template <>
26
SCORE_LIB_PROCESS_EXPORT void DataStreamWriter::write(Process::ProcessData& process)
×
27
{
28
  m_stream >> process.key >> process.prettyName >> process.customData;
×
29
}
×
30

31
template <>
32
SCORE_LIB_PROCESS_EXPORT void
33
DataStreamReader::read(const Process::ProcessModel& process)
745✔
34
{
35
  m_stream << process.m_duration << process.m_slotHeight << process.m_startOffset
745✔
36
           << process.m_loopDuration << process.m_position << process.m_size
745✔
37
           << process.m_loops << process.m_foldMode;
745✔
38
}
745✔
39

40
// We only load the members of the process here.
41
template <>
42
SCORE_LIB_PROCESS_EXPORT void DataStreamWriter::write(Process::ProcessModel& process)
342✔
43
{
44
  m_stream >> process.m_duration >> process.m_slotHeight >> process.m_startOffset
342✔
45
      >> process.m_loopDuration >> process.m_position >> process.m_size
342✔
46
      >> process.m_loops >> process.m_foldMode;
342✔
47
}
342✔
48

49
template <>
50
SCORE_LIB_PROCESS_EXPORT void JSONReader::read(const Process::ProcessModel& process)
686✔
51
{
52
  obj[strings.Duration] = process.duration();
686✔
53
  obj[strings.Height] = process.getSlotHeight();
686✔
54
  obj["StartOffset"] = process.startOffset();
686✔
55
  obj["LoopDuration"] = process.loopDuration();
686✔
56
  obj["Pos"] = process.m_position;
686✔
57
  obj["Size"] = process.m_size;
686✔
58
  obj["Loops"] = process.loops();
686✔
59
  obj["FoldMode"] = process.foldMode();
686✔
60
}
686✔
61

62
template <>
63
SCORE_LIB_PROCESS_EXPORT void JSONWriter::write(Process::ProcessModel& process)
354✔
64
{
65
  process.m_duration <<= obj[strings.Duration];
354✔
66

67
  if(auto it = obj.tryGet(strings.Height))
354✔
68
    process.m_slotHeight = it->toDouble();
354✔
69
  else
UNCOV
70
    process.m_slotHeight = 300;
×
71

72
  assign_with_default(process.m_startOffset, obj.tryGet("StartOffset"), TimeVal::zero());
354✔
73
  assign_with_default(
354✔
74
      process.m_loopDuration, obj.tryGet("LoopDuration"), TimeVal::fromMsecs(1000));
75
  assign_with_default(process.m_loops, obj.tryGet("Loops"), false);
354✔
76
  assign_with_default(process.m_position, obj.tryGet("Pos"), QPointF{});
354✔
77
  assign_with_default(process.m_size, obj.tryGet("Size"), QSize(200, 200));
354✔
78

79
  // Absent from every document written before fold state was stored: those must
80
  // keep getting the heuristic, which is what Auto means.
81
  assign_with_default(
354✔
82
      process.m_foldMode, obj.tryGet("FoldMode"), Process::FoldMode::Auto);
83
}
354✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc