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

sfc-aqua / quisp / 4329255112

pending completion
4329255112

Pull #504

github

GitHub
Merge 948c96a03 into 3166d7e57
Pull Request #504: Integrate Message Exchange (Purification/Entanglement Swapping) into RuleSet and Runtime

957 of 957 new or added lines in 22 files covered. (100.0%)

2287 of 5806 relevant lines covered (39.39%)

46937.47 hits per line

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

70.67
/quisp/rules/Clause.cc
1
#include "Clause.h"
2

3
namespace quisp::rules {
4

5
EnoughResourceConditionClause::EnoughResourceConditionClause(int num_resource, int partner_addr) : Clause(partner_addr), num_resource(num_resource) {}
30✔
6

7
json EnoughResourceConditionClause::serialize_json() {
23✔
8
  json enough_resource_json;
23✔
9
  enough_resource_json["type"] = "enough_resource";
23✔
10
  enough_resource_json["options"]["num_resource"] = num_resource;
23✔
11
  enough_resource_json["options"]["interface"]["partner_address"] = partner_address;
23✔
12
  return enough_resource_json;
23✔
13
}
23✔
14

15
void EnoughResourceConditionClause::deserialize_json(json serialized) {
3✔
16
  auto options = serialized["options"];
3✔
17
  if (options != nullptr) {
3✔
18
    // get options one by one
19
    options["num_resource"].get_to(num_resource);
3✔
20
    options["interface"]["partner_address"].get_to(partner_address);
3✔
21
  }
3✔
22
}
3✔
23

24
MeasureCountConditionClause::MeasureCountConditionClause(int num_measurement, int partner_addr) : Clause(partner_addr), num_measure(num_measurement) {}
8✔
25

26
json MeasureCountConditionClause::serialize_json() {
6✔
27
  json measure_count_json;
6✔
28
  measure_count_json["type"] = "measure_count";
6✔
29
  measure_count_json["options"]["num_measure"] = num_measure;
6✔
30
  measure_count_json["options"]["interface"]["partner_address"] = partner_address;
6✔
31
  return measure_count_json;
6✔
32
}
6✔
33

34
void MeasureCountConditionClause::deserialize_json(json serialized) {
1✔
35
  auto options = serialized["options"];
1✔
36
  if (options != nullptr) {
1✔
37
    // get options one by one
38
    options["num_measure"].get_to(num_measure);
1✔
39
    options["interface"]["partner_address"].get_to(partner_address);
1✔
40
  }
1✔
41
}
1✔
42

43
FidelityConditionClause::FidelityConditionClause(double required_fidelity, int partner_addr) : Clause(partner_addr), required_fidelity(required_fidelity) {}
1✔
44

45
json FidelityConditionClause::serialize_json() {
1✔
46
  json fidelity_json;
1✔
47
  fidelity_json["type"] = "fidelity";
1✔
48
  fidelity_json["options"]["required_fidelity"] = required_fidelity;
1✔
49
  fidelity_json["options"]["interface"]["partner_address"] = partner_address;
1✔
50
  return fidelity_json;
1✔
51
}
1✔
52

53
void FidelityConditionClause::deserialize_json(json serialized) {
1✔
54
  auto options = serialized["options"];
1✔
55
  if (options != nullptr) {
1✔
56
    // get options one by one
57
    options["required_fidelity"].get_to(required_fidelity);
1✔
58
    options["interface"]["partner_address"].get_to(partner_address);
1✔
59
  }
1✔
60
}
1✔
61

62
PurificationCorrelationClause::PurificationCorrelationClause(int partner_address, int shared_rule_tag) : Clause(partner_address), shared_rule_tag(shared_rule_tag) {}
×
63

64
json PurificationCorrelationClause::serialize_json() {
×
65
  json wait_json;
×
66
  wait_json["type"] = "purification_correlation";
×
67
  wait_json["options"]["interface"]["partner_address"] = partner_address;
×
68
  wait_json["options"]["shared_rule_tag"] = shared_rule_tag;
×
69
  return wait_json;
×
70
}
×
71

72
void PurificationCorrelationClause::deserialize_json(json serialized) {
×
73
  auto options = serialized["options"];
×
74
  if (options != nullptr) {
×
75
    options["interface"]["partner_address"].get_to(partner_address);
×
76
    options["shared_rule_tag"].get_to(shared_rule_tag);
×
77
  }
×
78
}
×
79

80
SwappingCorrectionClause::SwappingCorrectionClause(int swapper_address, int shared_rule_tag) : Clause(swapper_address), shared_rule_tag(shared_rule_tag) {}
14✔
81

82
json SwappingCorrectionClause::serialize_json() {
8✔
83
  json wait_json;
8✔
84
  wait_json["type"] = "swapping_correction";
8✔
85
  wait_json["options"]["interface"]["partner_address"] = partner_address;
8✔
86
  wait_json["options"]["shared_rule_tag"] = shared_rule_tag;
8✔
87
  return wait_json;
8✔
88
}
8✔
89

90
void SwappingCorrectionClause::deserialize_json(json serialized) {
×
91
  auto options = serialized["options"];
×
92
  if (options != nullptr) {
×
93
    options["interface"]["partner_address"].get_to(partner_address);
×
94
    options["shared_rule_tag"].get_to(shared_rule_tag);
×
95
  }
×
96
}
×
97

98
}  // namespace quisp::rules
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