The Trunk: KernelTests-eem.305.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: KernelTests-eem.305.mcz

commits-2
Eliot Miranda uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-eem.305.mcz

==================== Summary ====================

Name: KernelTests-eem.305
Author: eem
Time: 18 February 2016, 11:04:11.256415 pm
UUID: d8647b92-285c-42ae-8580-35e61dae6b5c
Ancestors: KernelTests-cmm.304

Expand on the process state tests to test more processes and to test the new isBlocked.

=============== Diff against KernelTests-cmm.304 ===============

Item was removed:
- ----- Method: ProcessTest>>testIsSuepended (in category 'tests') -----
- testIsSuepended
- | semaphore |
- self deny: Processor activeProcess isSuspended.
- semaphore := Semaphore new.
- "This process is runnable but hasn't got to the wait yet becasue the active process is running."
- self deny: ([semaphore wait] forkAt: Processor activePriority) isSuspended.
- self deny: ([semaphore wait] forkAt: Processor activePriority) suspendingList == semaphore.
- "This one does get to run because, being higher priority it preempts the active process until it waits on the semaphore.".
- self assert: ([semaphore wait] forkAt: Processor activePriority + 1) isSuspended.
- self assert: ([semaphore wait] forkAt: Processor activePriority + 1) suspendingList == semaphore!

Item was added:
+ ----- Method: ProcessTest>>testProcessStateTests (in category 'tests') -----
+ testProcessStateTests
+ | semaphore |
+ self assert: Processor activeProcess isActiveProcess.
+ self deny: Processor activeProcess isBlocked.
+ self assert: Processor activeProcess isRunnable.
+ self deny: Processor activeProcess isSuspended.
+ self deny: Processor activeProcess isTerminated.
+
+ semaphore := Semaphore new.
+
+ "These processes are runnable but haven't got to the wait yet because the active process is running."
+ self deny: ([semaphore wait] forkAt: Processor activePriority) isActiveProcess.
+ self deny: ([semaphore wait] forkAt: Processor activePriority) isBlocked.
+ self assert: ([semaphore wait] forkAt: Processor activePriority) isRunnable.
+ self deny: ([semaphore wait] forkAt: Processor activePriority) isSuspended.
+ self deny: ([semaphore wait] forkAt: Processor activePriority) isTerminated.
+ self deny: ([semaphore wait] forkAt: Processor activePriority) suspendingList == semaphore.
+
+ "These processes do get to run because, being higher priority they preempt the active process until yhey wait on the semaphore."
+ self deny: ([semaphore wait] forkAt: Processor activePriority + 1) isActiveProcess.
+ self assert: ([semaphore wait] forkAt: Processor activePriority + 1) isBlocked.
+ self deny: ([semaphore wait] forkAt: Processor activePriority + 1) isRunnable.
+ self deny: ([semaphore wait] forkAt: Processor activePriority + 1) isSuspended.
+ self deny: ([semaphore wait] forkAt: Processor activePriority + 1) isTerminated.
+ self assert: ([semaphore wait] forkAt: Processor activePriority + 1) suspendingList == semaphore.
+
+ "These processes should be suspended, not terminated."
+ self deny: ([Processor activeProcess suspend] forkAt: Processor activePriority + 1) isActiveProcess.
+ self deny: ([Processor activeProcess suspend] forkAt: Processor activePriority + 1) isBlocked.
+ self deny: ([Processor activeProcess suspend] forkAt: Processor activePriority + 1) isRunnable.
+ self assert: ([Processor activeProcess suspend] forkAt: Processor activePriority + 1) isSuspended.
+ self deny: ([Processor activeProcess suspend] forkAt: Processor activePriority + 1) isTerminated.
+ self assert: ([Processor activeProcess suspend] forkAt: Processor activePriority + 1) suspendingList isNil.
+
+ "These processes should be terminated, not suspended."
+ self deny: ([Processor activeProcess terminate] forkAt: Processor activePriority + 1) isActiveProcess.
+ self deny: ([Processor activeProcess terminate] forkAt: Processor activePriority + 1) isBlocked.
+ self deny: ([Processor activeProcess terminate] forkAt: Processor activePriority + 1) isRunnable.
+ self deny: ([Processor activeProcess terminate] forkAt: Processor activePriority + 1) isSuspended.
+ self assert: ([Processor activeProcess terminate] forkAt: Processor activePriority + 1) isTerminated.
+ self assert: ([Processor activeProcess terminate] forkAt: Processor activePriority + 1) suspendingList isNil.
+
+ "These processes should be suspended."
+ self deny: (([semaphore wait] forkAt: Processor activePriority) suspend; yourself) isActiveProcess.
+ self deny: (([semaphore wait] forkAt: Processor activePriority) suspend; yourself) isBlocked.
+ self deny: (([semaphore wait] forkAt: Processor activePriority) suspend; yourself) isRunnable.
+ self assert: (([semaphore wait] forkAt: Processor activePriority) suspend; yourself) isSuspended.
+ self deny: (([semaphore wait] forkAt: Processor activePriority) suspend; yourself) isTerminated.
+
+ "These processes should be terminated."
+ self deny: ([semaphore wait] forkAt: Processor activePriority) terminate isActiveProcess.
+ self deny: ([semaphore wait] forkAt: Processor activePriority) terminate isBlocked.
+ self deny: ([semaphore wait] forkAt: Processor activePriority) terminate isRunnable.
+ self deny: ([semaphore wait] forkAt: Processor activePriority) terminate isSuspended.
+ self assert: ([semaphore wait] forkAt: Processor activePriority) terminate isTerminated!