Skip to content

Commit fec61b4

Browse files
committed
cosmetic
1 parent 7a931a5 commit fec61b4

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

worker/test/include/helpers.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ namespace helpers
1212

1313
bool ReadPayloadData(const char* file, int pos, int bytes, uint8_t* payload);
1414

15+
bool AreBuffersEqual(const uint8_t* data1, size_t size1, const uint8_t* data2, size_t size2);
16+
1517
bool WriteRtpPacket(
1618
const char* file,
1719
uint8_t nalType,
@@ -25,8 +27,6 @@ namespace helpers
2527
uint8_t* buf,
2628
size_t* len);
2729

28-
bool AreBuffersEqual(const uint8_t* data1, size_t size1, const uint8_t* data2, size_t size2);
29-
3030
std::unique_ptr<RTC::RtpPacket> CreateRtpPacket(uint8_t* payload, size_t len);
3131
} // namespace helpers
3232

worker/test/src/helpers.cpp

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace helpers
1010
{
1111
bool ReadBinaryFile(const char* file, uint8_t* buffer, size_t* len)
1212
{
13+
MS_TRACE();
14+
1315
std::string filePath = "test/" + std::string(file);
1416

1517
#ifdef _WIN32
@@ -34,6 +36,8 @@ namespace helpers
3436

3537
bool AddToBuffer(uint8_t* buf, size_t* size, const uint8_t* data, size_t len)
3638
{
39+
MS_TRACE();
40+
3741
static size_t bufferSize{ 65536 };
3842

3943
if (*size + len > bufferSize)
@@ -62,6 +66,8 @@ namespace helpers
6266

6367
bool ReadPayloadData(const char* file, int pos, int bytes, uint8_t* payload)
6468
{
69+
MS_TRACE();
70+
6571
std::string filePath = "test/" + std::string(file);
6672

6773
#ifdef _WIN32
@@ -83,6 +89,18 @@ namespace helpers
8389
return true;
8490
}
8591

92+
bool AreBuffersEqual(const uint8_t* data1, size_t size1, const uint8_t* data2, size_t size2)
93+
{
94+
MS_TRACE();
95+
96+
if (size1 != size2)
97+
{
98+
return false;
99+
}
100+
101+
return std::memcmp(data1, data2, size1) == 0;
102+
}
103+
86104
bool WriteRtpPacket(
87105
const char* file,
88106
uint8_t /*nalType*/,
@@ -96,6 +114,8 @@ namespace helpers
96114
uint8_t* buf,
97115
size_t* len)
98116
{
117+
MS_TRACE();
118+
99119
std::string filePath = "test/" + std::string(file);
100120

101121
#ifdef _WIN32
@@ -203,20 +223,12 @@ namespace helpers
203223
return true;
204224
}
205225

206-
bool AreBuffersEqual(const uint8_t* data1, size_t size1, const uint8_t* data2, size_t size2)
207-
{
208-
if (size1 != size2)
209-
{
210-
return false;
211-
}
212-
213-
return std::memcmp(data1, data2, size1) == 0;
214-
}
215-
216226
static uint8_t Buffer[65536] = { 0 };
217227

218228
std::unique_ptr<RTC::RtpPacket> CreateRtpPacket(uint8_t* payload, size_t len)
219229
{
230+
MS_TRACE();
231+
220232
// clang-format off
221233
const uint8_t headers[] =
222234
{
@@ -236,6 +248,5 @@ namespace helpers
236248
rtpPacket.reset(rtpPacket->Clone());
237249

238250
return rtpPacket;
239-
}
240-
251+
}
241252
} // namespace helpers

0 commit comments

Comments
 (0)