Skip to content

Commit be254e7

Browse files
committed
[tests] Minor fix of variable shadowing.
1 parent 30e7ccd commit be254e7

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

test/test_bonding.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ TEST(Bonding, SRTConnectGroup)
2929
targets.push_back(gd);
3030
}
3131

32-
std::future<void> closing_promise = std::async(std::launch::async, [](int ss) {
32+
std::future<void> closing_promise = std::async(std::launch::async, [](int s) {
3333
std::this_thread::sleep_for(std::chrono::seconds(2));
3434
std::cerr << "Closing group" << std::endl;
35-
srt_close(ss);
35+
srt_close(s);
3636
}, ss);
3737

3838
std::cout << "srt_connect_group calling " << std::endl;

test/test_sync.cpp

+15-15
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,9 @@ TEST(SyncEvent, WaitForNotifyOne)
385385

386386
const steady_clock::duration timeout = seconds_from(5);
387387

388-
auto wait_async = [](Condition* cond, Mutex* mutex, const steady_clock::duration& timeout) {
389-
CUniqueSync cc (*mutex, *cond);
390-
return cc.wait_for(timeout);
388+
auto wait_async = [](Condition* cv, Mutex* m, const steady_clock::duration& tmo) {
389+
CUniqueSync cc (*m, *cv);
390+
return cc.wait_for(tmo);
391391
};
392392
auto wait_async_res = async(launch::async, wait_async, &cond, &mutex, timeout);
393393

@@ -406,9 +406,9 @@ TEST(SyncEvent, WaitNotifyOne)
406406
Condition cond;
407407
cond.init();
408408

409-
auto wait_async = [](Condition* cond, Mutex* mutex) {
410-
UniqueLock lock(*mutex);
411-
return cond->wait(lock);
409+
auto wait_async = [](Condition* cv, Mutex* m) {
410+
UniqueLock lock(*m);
411+
return cv->wait(lock);
412412
};
413413
auto wait_async_res = async(launch::async, wait_async, &cond, &mutex);
414414

@@ -432,9 +432,9 @@ TEST(SyncEvent, WaitForTwoNotifyOne)
432432

433433
srt::sync::atomic<bool> resource_ready(true);
434434

435-
auto wait_async = [&](Condition* cond, Mutex* mutex, const steady_clock::duration& timeout, int id) {
436-
UniqueLock lock(*mutex);
437-
if (cond->wait_for(lock, timeout) && resource_ready)
435+
auto wait_async = [&](Condition* cv, Mutex* m, const steady_clock::duration& tmo, int id) {
436+
UniqueLock lock(*m);
437+
if (cv->wait_for(lock, tmo) && resource_ready)
438438
{
439439
notified_clients.push_back(id);
440440
resource_ready = false;
@@ -536,9 +536,9 @@ TEST(SyncEvent, WaitForTwoNotifyAll)
536536
cond.init();
537537
const steady_clock::duration timeout = seconds_from(3);
538538

539-
auto wait_async = [](Condition* cond, Mutex* mutex, const steady_clock::duration& timeout) {
540-
UniqueLock lock(*mutex);
541-
return cond->wait_for(lock, timeout);
539+
auto wait_async = [](Condition* cv, Mutex* m, const steady_clock::duration& tmo) {
540+
UniqueLock lock(*m);
541+
return cv->wait_for(lock, tmo);
542542
};
543543
auto wait_async1_res = async(launch::async, wait_async, &cond, &mutex, timeout);
544544
auto wait_async2_res = async(launch::async, wait_async, &cond, &mutex, timeout);
@@ -565,9 +565,9 @@ TEST(SyncEvent, WaitForNotifyAll)
565565
cond.init();
566566
const steady_clock::duration timeout = seconds_from(5);
567567

568-
auto wait_async = [](Condition* cond, Mutex* mutex, const steady_clock::duration& timeout) {
569-
UniqueLock lock(*mutex);
570-
return cond->wait_for(lock, timeout);
568+
auto wait_async = [](Condition* cv, Mutex* m, const steady_clock::duration& tmo) {
569+
UniqueLock lock(*m);
570+
return cv->wait_for(lock, tmo);
571571
};
572572
auto wait_async_res = async(launch::async, wait_async, &cond, &mutex, timeout);
573573

0 commit comments

Comments
 (0)