Skip to content

Commit f8001bc

Browse files
author
dave
committed
Remove incorrect usage of lock from tests
1 parent a4c1d4e commit f8001bc

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

tests/taskMgrTests/reentrantLockingTests.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -57,47 +57,3 @@ test(testGettingRunningTaskAlwaysCorrect) {
5757
assertMore(runCount1, 30);
5858
assertMore(runCount2, 250);
5959
}
60-
61-
test(testReentrantLock) {
62-
taskManager.reset();
63-
64-
allGood = true;
65-
runCount1 = runCount2 = runCount3 = 0;
66-
67-
runTaskId1 = taskManager.scheduleFixedRate(10, [] {
68-
if(testLock.tryLock()) {
69-
if(captureCount3 != runCount3 || captureCount2 != runCount2) {
70-
allGood = false;
71-
}
72-
testLock.unlock();
73-
}
74-
else {
75-
testLock.lock();
76-
captureCount2 = runCount2;
77-
captureCount3 = runCount3;
78-
}
79-
runCount1++;
80-
}, TIME_MILLIS);
81-
82-
runTaskId2 = taskManager.scheduleFixedRate(100, [] {
83-
TaskMgrLock locker(testLock);
84-
runCount2++;
85-
}, TIME_MICROS);
86-
87-
taskManager.scheduleFixedRate(50, [] {
88-
TaskMgrLock locker(testLock);
89-
runCount3++;
90-
}, TIME_MICROS);
91-
92-
while(runCount1 < 10 || testLock.isLocked()) {
93-
taskManager.yieldForMicros(100);
94-
}
95-
96-
assertTrue(allGood);
97-
assertTrue(runTaskId1 != TASKMGR_INVALIDID);
98-
assertTrue(runTaskId2 != TASKMGR_INVALIDID);
99-
assertMore(runCount1, 9);
100-
assertLess(runCount1, 12);
101-
assertMore(runCount2, 200);
102-
assertMore(runCount3, 200);
103-
}

0 commit comments

Comments
 (0)