summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-02-20 09:38:56 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-02-20 09:38:56 +0100
commita01003265bf80a7335b54e697cfaa5bf3d8e561a (patch)
tree803479274be4b31a370ed9c2a2c342ffb5e987dc
parentced5898a3146bf53e7ccfe377d431ea59e368e1d (diff)
dispatcher: Add a small testcase for the dispatcher in error conditions
-rw-r--r--Tests.st16
-rw-r--r--package.xml1
2 files changed, 17 insertions, 0 deletions
diff --git a/Tests.st b/Tests.st
index 8009d8c..35d2cb5 100644
--- a/Tests.st
+++ b/Tests.st
@@ -16,6 +16,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"
+TestCase subclass: DispatcherTest [
+ <category: 'OsmoCore-Tests'>
+
+ testDispatcher [
+ | sem |
+ sem := Semaphore new.
+
+ self assert: sem signals = 0.
+ "Force a debugger or some abortion? And a log message"
+ OsmoDispatcher dispatchBlock: [123 unknownMessageForSmallInteger].
+ OsmoDispatcher dispatchBlock: [Processor activeProcess terminate].
+ OsmoDispatcher dispatchBlock: [sem signal].
+ self assert: sem signals = 1.
+ ]
+]
+
TestCase subclass: TimerTest [
<category: 'OsmoCore-Tests'>
diff --git a/package.xml b/package.xml
index 7e270b5..4dbdc45 100644
--- a/package.xml
+++ b/package.xml
@@ -8,6 +8,7 @@
<filein>Timer.st</filein>
<test>
+ <sunit>Osmo.DispatcherTest</sunit>
<sunit>Osmo.TimerTest</sunit>
<filein>Tests.st</filein>
</test>