mediasoup 3.19.19 → 3.19.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/node/lib/Worker.d.ts +1 -1
- package/node/lib/Worker.d.ts.map +1 -1
- package/node/lib/Worker.js +8 -2
- package/node/lib/WorkerTypes.d.ts +8 -4
- package/node/lib/WorkerTypes.d.ts.map +1 -1
- package/node/lib/index.d.ts +1 -1
- package/node/lib/index.d.ts.map +1 -1
- package/node/lib/index.js +2 -1
- package/node/lib/sctpParametersTypes.d.ts +3 -13
- package/node/lib/sctpParametersTypes.d.ts.map +1 -1
- package/node/lib/test/test-PlainTransport.js +8 -3
- package/node/lib/test/test-WebRtcTransport.js +9 -4
- package/package.json +10 -10
- package/worker/Makefile +0 -4
- package/worker/fuzzer/src/fuzzer.cpp +6 -5
- package/worker/include/RTC/DataConsumer.hpp +4 -14
- package/worker/include/RTC/SCTP/TODO_SCTP.md +18 -10
- package/worker/include/RTC/SCTP/association/Association.hpp +39 -31
- package/worker/include/RTC/SCTP/association/{AssociationDeferredListener.hpp → AssociationListenerDeferrer.hpp} +10 -8
- package/worker/include/RTC/SCTP/association/HeartbeatHandler.hpp +77 -0
- package/worker/include/RTC/SCTP/association/NegotiatedCapabilities.hpp +2 -2
- package/worker/include/RTC/SCTP/association/PacketSender.hpp +2 -2
- package/worker/include/RTC/SCTP/association/StateCookie.hpp +2 -2
- package/worker/include/RTC/SCTP/association/StreamResetHandler.hpp +272 -0
- package/worker/include/RTC/SCTP/association/TCBContext.hpp +67 -0
- package/worker/include/RTC/SCTP/association/TransmissionControlBlock.hpp +81 -11
- package/worker/include/RTC/SCTP/common/UnwrappedSequenceNumber.hpp +274 -0
- package/worker/include/RTC/SCTP/packet/Chunk.hpp +0 -1
- package/worker/include/RTC/SCTP/packet/UserData.hpp +1 -0
- package/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +14 -10
- package/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +14 -10
- package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +13 -2
- package/worker/include/RTC/SCTP/public/AssociationInterface.hpp +7 -1
- package/worker/include/RTC/SCTP/public/AssociationListener.hpp +11 -0
- package/worker/include/RTC/SCTP/public/Message.hpp +1 -0
- package/worker/include/RTC/SCTP/public/SctpOptions.hpp +4 -4
- package/worker/include/RTC/SctpAssociation.hpp +2 -2
- package/worker/include/RTC/Transport.hpp +9 -13
- package/worker/include/Settings.hpp +2 -1
- package/worker/include/Utils.hpp +130 -6
- package/worker/meson.build +10 -39
- package/worker/meson_options.txt +0 -1
- package/worker/scripts/package-lock.json +6 -6
- package/worker/src/DepLibUring.cpp +1 -1
- package/worker/src/RTC/DataConsumer.cpp +5 -29
- package/worker/src/RTC/PipeTransport.cpp +15 -12
- package/worker/src/RTC/PlainTransport.cpp +15 -12
- package/worker/src/RTC/RTP/RetransmissionBuffer.cpp +5 -5
- package/worker/src/RTC/RTP/RtpStream.cpp +2 -2
- package/worker/src/RTC/RTP/RtxStream.cpp +1 -1
- package/worker/src/RTC/RateCalculator.cpp +5 -5
- package/worker/src/RTC/SCTP/association/Association.cpp +218 -148
- package/worker/src/RTC/SCTP/association/{AssociationDeferredListener.cpp → AssociationListenerDeferrer.cpp} +38 -30
- package/worker/src/RTC/SCTP/association/HeartbeatHandler.cpp +244 -0
- package/worker/src/RTC/SCTP/association/NegotiatedCapabilities.cpp +8 -6
- package/worker/src/RTC/SCTP/association/PacketSender.cpp +7 -2
- package/worker/src/RTC/SCTP/association/StateCookie.cpp +8 -8
- package/worker/src/RTC/SCTP/association/StreamResetHandler.cpp +512 -0
- package/worker/src/RTC/SCTP/association/TransmissionControlBlock.cpp +45 -39
- package/worker/src/RTC/SCTP/packet/chunks/SackChunk.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/errorCauses/UserInitiatedAbortErrorCause.cpp +1 -1
- package/worker/src/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.cpp +22 -5
- package/worker/src/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.cpp +22 -5
- package/worker/src/RTC/SCTP/tx/RetransmissionErrorCounter.cpp +1 -1
- package/worker/src/RTC/SctpAssociation.cpp +1 -2
- package/worker/src/RTC/SeqManager.cpp +4 -4
- package/worker/src/RTC/Transport.cpp +247 -134
- package/worker/src/RTC/WebRtcTransport.cpp +9 -5
- package/worker/src/Settings.cpp +21 -1
- package/worker/src/Worker.cpp +13 -10
- package/worker/src/lib.cpp +11 -8
- package/worker/tasks.py +2 -35
- package/worker/test/src/RTC/SCTP/association/TestNegotiatedCapabilities.cpp +13 -12
- package/worker/test/src/RTC/SCTP/association/TestStateCookie.cpp +20 -20
- package/worker/test/src/RTC/SCTP/common/TestUnwrappedSequenceNumber.cpp +210 -0
- package/worker/test/src/RTC/SCTP/packet/chunks/TestAbortAssociationChunk.cpp +2 -2
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatAckChunk.cpp +9 -4
- package/worker/test/src/RTC/SCTP/packet/chunks/TestHeartbeatRequestChunk.cpp +5 -0
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitAckChunk.cpp +1 -1
- package/worker/test/src/RTC/SCTP/packet/chunks/TestInitChunk.cpp +5 -5
- package/worker/test/src/RTC/SCTP/packet/chunks/TestReConfigChunk.cpp +19 -20
- package/worker/test/src/RTC/SCTP/packet/chunks/TestUnknownChunk.cpp +3 -0
- package/worker/test/src/RTC/SCTP/packet/errorCauses/TestUnknownErrorCause.cpp +3 -0
- package/worker/test/src/RTC/SCTP/packet/parameters/TestIncomingSsnResetRequestParameter.cpp +24 -27
- package/worker/test/src/RTC/SCTP/packet/parameters/TestOutgoingSsnResetRequestParameter.cpp +25 -30
- package/worker/test/src/RTC/SCTP/packet/parameters/TestStateCookieParameter.cpp +8 -6
- package/worker/test/src/RTC/SCTP/packet/parameters/TestSupportedExtensionsParameter.cpp +12 -0
- package/worker/test/src/RTC/SCTP/packet/parameters/TestZeroChecksumAcceptableParameter.cpp +5 -8
- package/worker/test/src/Utils/TestNumber.cpp +119 -49
- package/worker/test/src/tests.cpp +11 -8
|
@@ -8,122 +8,192 @@ SCENARIO("Utils::Number", "[utils][number]")
|
|
|
8
8
|
SECTION("IsEqualThan()")
|
|
9
9
|
{
|
|
10
10
|
// 0 is not equal than 16.
|
|
11
|
-
REQUIRE(Utils::Number<uint16_t
|
|
11
|
+
REQUIRE(Utils::Number::IsEqualThan<uint16_t>(0, 16) == false);
|
|
12
12
|
|
|
13
13
|
// Using N=4 bits, 0 is equal than 16.
|
|
14
|
-
REQUIRE(Utils::Number<uint8_t, 4
|
|
15
|
-
REQUIRE(Utils::Number<uint16_t, 4
|
|
16
|
-
REQUIRE(Utils::Number<uint32_t, 4
|
|
17
|
-
REQUIRE(Utils::Number<uint64_t, 4
|
|
14
|
+
REQUIRE(Utils::Number::IsEqualThan<uint8_t, 4>(0, 16) == true);
|
|
15
|
+
REQUIRE(Utils::Number::IsEqualThan<uint16_t, 4>(0, 16) == true);
|
|
16
|
+
REQUIRE(Utils::Number::IsEqualThan<uint32_t, 4>(0, 16) == true);
|
|
17
|
+
REQUIRE(Utils::Number::IsEqualThan<uint64_t, 4>(0, 16) == true);
|
|
18
18
|
|
|
19
19
|
// Using N=7 bits, 0 is equal than 128.
|
|
20
|
-
REQUIRE(Utils::Number<uint8_t, 7
|
|
21
|
-
REQUIRE(Utils::Number<uint16_t, 7
|
|
22
|
-
REQUIRE(Utils::Number<uint32_t, 7
|
|
23
|
-
REQUIRE(Utils::Number<uint64_t, 7
|
|
20
|
+
REQUIRE(Utils::Number::IsEqualThan<uint8_t, 7>(0, 128) == true);
|
|
21
|
+
REQUIRE(Utils::Number::IsEqualThan<uint16_t, 7>(0, 128) == true);
|
|
22
|
+
REQUIRE(Utils::Number::IsEqualThan<uint32_t, 7>(0, 128) == true);
|
|
23
|
+
REQUIRE(Utils::Number::IsEqualThan<uint64_t, 7>(0, 128) == true);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
SECTION("IsHigherThan()")
|
|
27
27
|
{
|
|
28
28
|
// 10 is higher than std::numeric_limits<uint8_t>::max().
|
|
29
|
-
REQUIRE(Utils::Number<uint8_t
|
|
29
|
+
REQUIRE(Utils::Number::IsHigherThan<uint8_t>(10, std::numeric_limits<uint8_t>::max()) == true);
|
|
30
30
|
|
|
31
31
|
// 0 is greater than std::numeric_limits<uint64_t>::max().
|
|
32
|
-
REQUIRE(Utils::Number<uint64_t
|
|
32
|
+
REQUIRE(Utils::Number::IsHigherThan<uint64_t>(0, std::numeric_limits<uint64_t>::max()) == true);
|
|
33
33
|
|
|
34
34
|
// std::numeric_limits<uint64_t>::max() / 2) - 1 is higher than
|
|
35
35
|
// std::numeric_limits<uint64_t>::max().
|
|
36
36
|
REQUIRE(
|
|
37
|
-
Utils::Number<uint64_t
|
|
37
|
+
Utils::Number::IsHigherThan<uint64_t>(
|
|
38
38
|
(std::numeric_limits<uint64_t>::max() / 2) - 1, std::numeric_limits<uint64_t>::max()) == true);
|
|
39
39
|
|
|
40
40
|
// std::numeric_limits<uint64_t>::max() is higher than
|
|
41
41
|
// (std::numeric_limits<uint64_t>::max() / 2) + 1.
|
|
42
42
|
REQUIRE(
|
|
43
|
-
Utils::Number<uint64_t
|
|
43
|
+
Utils::Number::IsHigherThan<uint64_t>(
|
|
44
44
|
std::numeric_limits<uint64_t>::max(), (std::numeric_limits<uint64_t>::max() / 2) + 1) == true);
|
|
45
45
|
|
|
46
46
|
// Using N=4 bits, 0 is higher than 14.
|
|
47
|
-
REQUIRE(Utils::Number<uint8_t, 4
|
|
48
|
-
REQUIRE(Utils::Number<uint16_t, 4
|
|
49
|
-
REQUIRE(Utils::Number<uint32_t, 4
|
|
50
|
-
REQUIRE(Utils::Number<uint64_t, 4
|
|
47
|
+
REQUIRE(Utils::Number::IsHigherThan<uint8_t, 4>(0, 14) == true);
|
|
48
|
+
REQUIRE(Utils::Number::IsHigherThan<uint16_t, 4>(0, 14) == true);
|
|
49
|
+
REQUIRE(Utils::Number::IsHigherThan<uint32_t, 4>(0, 14) == true);
|
|
50
|
+
REQUIRE(Utils::Number::IsHigherThan<uint64_t, 4>(0, 14) == true);
|
|
51
51
|
|
|
52
52
|
// Using N=6 bits, 0 is not higher than 64.
|
|
53
|
-
REQUIRE(Utils::Number<uint8_t, 6
|
|
54
|
-
REQUIRE(Utils::Number<uint16_t, 6
|
|
55
|
-
REQUIRE(Utils::Number<uint32_t, 6
|
|
56
|
-
REQUIRE(Utils::Number<uint64_t, 6
|
|
53
|
+
REQUIRE(Utils::Number::IsHigherThan<uint8_t, 6>(0, 64) == false);
|
|
54
|
+
REQUIRE(Utils::Number::IsHigherThan<uint16_t, 6>(0, 64) == false);
|
|
55
|
+
REQUIRE(Utils::Number::IsHigherThan<uint32_t, 6>(0, 64) == false);
|
|
56
|
+
REQUIRE(Utils::Number::IsHigherThan<uint64_t, 6>(0, 64) == false);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
SECTION("IsLowerThan()")
|
|
60
60
|
{
|
|
61
61
|
// 1 is lower than 2.
|
|
62
|
-
REQUIRE(Utils::Number<uint8_t
|
|
62
|
+
REQUIRE(Utils::Number::IsLowerThan<uint8_t>(1, 2) == true);
|
|
63
63
|
|
|
64
64
|
// std::numeric_limits<uint8_t>::max() is lower than 0.
|
|
65
|
-
REQUIRE(Utils::Number<uint8_t
|
|
65
|
+
REQUIRE(Utils::Number::IsLowerThan<uint8_t>(std::numeric_limits<uint8_t>::max(), 0) == true);
|
|
66
66
|
|
|
67
67
|
// 1000000 is lower than 2000000.
|
|
68
|
-
REQUIRE(Utils::Number<uint64_t
|
|
68
|
+
REQUIRE(Utils::Number::IsLowerThan<uint64_t>(1000000, 2000000) == true);
|
|
69
69
|
|
|
70
70
|
// std::numeric_limits<uint64_t>::max() is lower than 0.
|
|
71
|
-
REQUIRE(Utils::Number<uint64_t
|
|
71
|
+
REQUIRE(Utils::Number::IsLowerThan<uint64_t>(std::numeric_limits<uint64_t>::max(), 0) == true);
|
|
72
72
|
|
|
73
73
|
// (std::numeric_limits<uint64_t>::max() / 2) + 1 is lower than
|
|
74
74
|
// std::numeric_limits<uint64_t>::max().
|
|
75
75
|
REQUIRE(
|
|
76
|
-
Utils::Number<uint64_t
|
|
76
|
+
Utils::Number::IsLowerThan<uint64_t>(
|
|
77
77
|
(std::numeric_limits<uint64_t>::max() / 2) + 1, std::numeric_limits<uint64_t>::max()) == true);
|
|
78
78
|
|
|
79
79
|
// std::numeric_limits<uint64_t>::max() is lower than
|
|
80
80
|
// (std::numeric_limits<uint64_t>::max() / 2) - 1.
|
|
81
81
|
REQUIRE(
|
|
82
|
-
Utils::Number<uint64_t
|
|
82
|
+
Utils::Number::IsLowerThan<uint64_t>(
|
|
83
83
|
std::numeric_limits<uint64_t>::max(), (std::numeric_limits<uint64_t>::max() / 2) - 1) == true);
|
|
84
84
|
|
|
85
85
|
// Using N=3 bits, 7 is lower than 2.
|
|
86
|
-
REQUIRE(Utils::Number<uint8_t, 3
|
|
87
|
-
REQUIRE(Utils::Number<uint16_t, 3
|
|
88
|
-
REQUIRE(Utils::Number<uint32_t, 3
|
|
89
|
-
REQUIRE(Utils::Number<uint64_t, 3
|
|
86
|
+
REQUIRE(Utils::Number::IsLowerThan<uint8_t, 3>(15, 2) == true);
|
|
87
|
+
REQUIRE(Utils::Number::IsLowerThan<uint16_t, 3>(15, 2) == true);
|
|
88
|
+
REQUIRE(Utils::Number::IsLowerThan<uint32_t, 3>(15, 2) == true);
|
|
89
|
+
REQUIRE(Utils::Number::IsLowerThan<uint64_t, 3>(15, 2) == true);
|
|
90
90
|
|
|
91
91
|
// Using N=2 bits, 3 is lower than 1.
|
|
92
|
-
REQUIRE(Utils::Number<uint8_t, 2
|
|
93
|
-
REQUIRE(Utils::Number<uint16_t, 2
|
|
94
|
-
REQUIRE(Utils::Number<uint32_t, 2
|
|
95
|
-
REQUIRE(Utils::Number<uint64_t, 2
|
|
92
|
+
REQUIRE(Utils::Number::IsLowerThan<uint8_t, 2>(3, 1) == true);
|
|
93
|
+
REQUIRE(Utils::Number::IsLowerThan<uint16_t, 2>(3, 1) == true);
|
|
94
|
+
REQUIRE(Utils::Number::IsLowerThan<uint32_t, 2>(3, 1) == true);
|
|
95
|
+
REQUIRE(Utils::Number::IsLowerThan<uint64_t, 2>(3, 1) == true);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
SECTION("IsHigherOrEqualThan()")
|
|
99
99
|
{
|
|
100
100
|
// 0 is greater or equal than std::numeric_limits<uint64_t>::max().
|
|
101
101
|
REQUIRE(
|
|
102
|
-
Utils::Number<uint64_t
|
|
102
|
+
Utils::Number::IsHigherOrEqualThan<uint64_t>(0, std::numeric_limits<uint64_t>::max()) == true);
|
|
103
103
|
|
|
104
104
|
// Using N=5 bits, 0 is higher or equal than 32.
|
|
105
|
-
REQUIRE(Utils::Number<uint8_t, 5
|
|
106
|
-
REQUIRE(Utils::Number<uint16_t, 5
|
|
107
|
-
REQUIRE(Utils::Number<uint32_t, 5
|
|
108
|
-
REQUIRE(Utils::Number<uint64_t, 5
|
|
105
|
+
REQUIRE(Utils::Number::IsHigherOrEqualThan<uint8_t, 5>(0, 32) == true);
|
|
106
|
+
REQUIRE(Utils::Number::IsHigherOrEqualThan<uint16_t, 5>(0, 32) == true);
|
|
107
|
+
REQUIRE(Utils::Number::IsHigherOrEqualThan<uint32_t, 5>(0, 32) == true);
|
|
108
|
+
REQUIRE(Utils::Number::IsHigherOrEqualThan<uint64_t, 5>(0, 32) == true);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
SECTION("IsLowerOrEqualThan()")
|
|
112
112
|
{
|
|
113
113
|
// std::numeric_limits<uint64_t>::max() is lower or equal than 0.
|
|
114
114
|
REQUIRE(
|
|
115
|
-
Utils::Number<uint64_t
|
|
115
|
+
Utils::Number::IsLowerOrEqualThan<uint64_t>(std::numeric_limits<uint64_t>::max(), 0) == true);
|
|
116
116
|
|
|
117
117
|
// Using N=2 bits, 0 is lower or equal than 4.
|
|
118
|
-
REQUIRE(Utils::Number<uint8_t, 2
|
|
119
|
-
REQUIRE(Utils::Number<uint16_t, 2
|
|
120
|
-
REQUIRE(Utils::Number<uint32_t, 2
|
|
121
|
-
REQUIRE(Utils::Number<uint64_t, 2
|
|
118
|
+
REQUIRE(Utils::Number::IsLowerOrEqualThan<uint8_t, 2>(0, 4) == true);
|
|
119
|
+
REQUIRE(Utils::Number::IsLowerOrEqualThan<uint16_t, 2>(0, 4) == true);
|
|
120
|
+
REQUIRE(Utils::Number::IsLowerOrEqualThan<uint32_t, 2>(0, 4) == true);
|
|
121
|
+
REQUIRE(Utils::Number::IsLowerOrEqualThan<uint64_t, 2>(0, 4) == true);
|
|
122
122
|
|
|
123
123
|
// Using N=2 bits, 3 is lower or equal than 1.
|
|
124
|
-
REQUIRE(Utils::Number<uint8_t, 2
|
|
125
|
-
REQUIRE(Utils::Number<uint16_t, 2
|
|
126
|
-
REQUIRE(Utils::Number<uint32_t, 2
|
|
127
|
-
REQUIRE(Utils::Number<uint64_t, 2
|
|
124
|
+
REQUIRE(Utils::Number::IsLowerOrEqualThan<uint8_t, 2>(3, 1) == true);
|
|
125
|
+
REQUIRE(Utils::Number::IsLowerOrEqualThan<uint16_t, 2>(3, 1) == true);
|
|
126
|
+
REQUIRE(Utils::Number::IsLowerOrEqualThan<uint32_t, 2>(3, 1) == true);
|
|
127
|
+
REQUIRE(Utils::Number::IsLowerOrEqualThan<uint64_t, 2>(3, 1) == true);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
SECTION("ForwardDiff()")
|
|
131
|
+
{
|
|
132
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ForwardDiff(4711u, 4711u)) == 0);
|
|
133
|
+
|
|
134
|
+
uint8_t x{ 0 };
|
|
135
|
+
uint8_t y{ 255 };
|
|
136
|
+
|
|
137
|
+
for (uint16_t i{ 0 }; i < 256; ++i)
|
|
138
|
+
{
|
|
139
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ForwardDiff(x, y)) == 255);
|
|
140
|
+
|
|
141
|
+
++x;
|
|
142
|
+
++y;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
uint32_t yi{ 255 };
|
|
146
|
+
|
|
147
|
+
for (uint16_t i{ 0 }; i < 512; ++i)
|
|
148
|
+
{
|
|
149
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ForwardDiff<uint8_t>(x, yi)) == 255);
|
|
150
|
+
|
|
151
|
+
++x;
|
|
152
|
+
++yi;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
SECTION("ForwardDiff() with divisor")
|
|
157
|
+
{
|
|
158
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ForwardDiff<uint8_t, 123>(0, 122)) == 122);
|
|
159
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ForwardDiff<uint8_t, 123>(122, 122)) == 0);
|
|
160
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ForwardDiff<uint8_t, 123>(1, 0)) == 122);
|
|
161
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ForwardDiff<uint8_t, 123>(0, 0)) == 0);
|
|
162
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ForwardDiff<uint8_t, 123>(122, 0)) == 1);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
SECTION("ReverseDiff()")
|
|
166
|
+
{
|
|
167
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ReverseDiff(4711u, 4711u)) == 0);
|
|
168
|
+
|
|
169
|
+
uint8_t x{ 0 };
|
|
170
|
+
uint8_t y{ 255 };
|
|
171
|
+
|
|
172
|
+
for (uint16_t i{ 0 }; i < 256; ++i)
|
|
173
|
+
{
|
|
174
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ReverseDiff(x, y)) == 1);
|
|
175
|
+
|
|
176
|
+
++x;
|
|
177
|
+
++y;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
uint32_t yi{ 255 };
|
|
181
|
+
|
|
182
|
+
for (uint16_t i{ 0 }; i < 512; ++i)
|
|
183
|
+
{
|
|
184
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ReverseDiff<uint8_t>(x, yi)) == 1);
|
|
185
|
+
|
|
186
|
+
++x;
|
|
187
|
+
++yi;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
SECTION("ReverseDiff() with divisor")
|
|
192
|
+
{
|
|
193
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ReverseDiff<uint8_t, 123>(0, 122)) == 1);
|
|
194
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ReverseDiff<uint8_t, 123>(122, 122)) == 0);
|
|
195
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ReverseDiff<uint8_t, 123>(1, 0)) == 1);
|
|
196
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ReverseDiff<uint8_t, 123>(0, 0)) == 0);
|
|
197
|
+
REQUIRE(static_cast<uint64_t>(Utils::Number::ReverseDiff<uint8_t, 123>(122, 0)) == 122);
|
|
128
198
|
}
|
|
129
199
|
}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
#include "DepLibUV.hpp"
|
|
4
4
|
#include "DepLibWebRTC.hpp"
|
|
5
5
|
#include "DepOpenSSL.hpp"
|
|
6
|
-
|
|
6
|
+
// TODO: Remove once we only use built-in SCTP stack.
|
|
7
7
|
#include "DepUsrSCTP.hpp"
|
|
8
|
-
#endif
|
|
9
8
|
#include "Settings.hpp"
|
|
10
9
|
#include "Utils.hpp"
|
|
11
10
|
#include <catch2/catch_session.hpp>
|
|
@@ -49,9 +48,11 @@ int main(int argc, char* argv[])
|
|
|
49
48
|
DepLibUV::ClassInit();
|
|
50
49
|
DepOpenSSL::ClassInit();
|
|
51
50
|
DepLibSRTP::ClassInit();
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
// TODO: Remove once we only use built-in SCTP stack.
|
|
52
|
+
if (!Settings::configuration.useBuiltInSctpStack)
|
|
53
|
+
{
|
|
54
|
+
DepUsrSCTP::ClassInit();
|
|
55
|
+
}
|
|
55
56
|
DepLibWebRTC::ClassInit();
|
|
56
57
|
Utils::Crypto::ClassInit();
|
|
57
58
|
|
|
@@ -63,9 +64,11 @@ int main(int argc, char* argv[])
|
|
|
63
64
|
DepLibSRTP::ClassDestroy();
|
|
64
65
|
Utils::Crypto::ClassDestroy();
|
|
65
66
|
DepLibWebRTC::ClassDestroy();
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
// TODO: Remove once we only use built-in SCTP stack.
|
|
68
|
+
if (!Settings::configuration.useBuiltInSctpStack)
|
|
69
|
+
{
|
|
70
|
+
DepUsrSCTP::ClassDestroy();
|
|
71
|
+
}
|
|
69
72
|
DepLibUV::ClassDestroy();
|
|
70
73
|
|
|
71
74
|
return status;
|