Index: /tests/SystemQueue-tests.cc
===================================================================
--- /tests/SystemQueue-tests.cc	(revision 12753)
+++ /tests/SystemQueue-tests.cc	(revision 12754)
@@ -112,4 +112,7 @@
     void OrderedCall(int num)
     {
+        // XXX
+        cout << "### OrderedCall num: " << num << endl;
+        
         // check ordering
         EXPECT_EQ( num, last_ordered_call + 1);
@@ -273,6 +276,6 @@
  *  but should not lengthen the test excessivly
  */
-#define DELAY_TIME 10  // ms
-#define DELAY_MARGIN 1000  // microseconds (1/1000 ms)
+#define DELAY_TIME 20  // ms
+#define DELAY_MARGIN 2000  // microseconds (1/1000 ms)
 
 
@@ -308,15 +311,60 @@
     // scheduleCall
     sysq.scheduleCall(
-        boost::bind(&SystemQueueTest::Check, this), DELAY_TIME
+        boost::bind(&SystemQueueTimingTest::Check, this), DELAY_TIME
     );
 
     // noting to do until the delay is up..
-    usleep(DELAY_TIME + DELAY_MARGIN);
+    usleep(DELAY_TIME + DELAY_MARGIN*10);  // XXX margin too high (TODO lower when SysQ is reimplemented)
     
     // wait for the event to happen
     wait_for_checkmark(MAX_WAIT);
     
-    EXPECT_TRUE( checkmark ) << "Deleyed function was not called within delaytime (" 
+    EXPECT_TRUE( checkmark ) << "Delayed function was not called within delaytime (" 
         << DELAY_TIME << " ms) + " << (MAX_WAIT + DELAY_MARGIN) << " microseconds.";
 }
 
+
+/**
+ *  schedules a delayed call and tests whether it is called (more or less timely..)
+ */
+TEST_F(SystemQueueTimingTest, MultipleCalls)
+{
+    // schedule 4th call 
+    sysq.scheduleCall(
+        boost::bind(&SystemQueueTest::OrderedCall, this, 4),
+                    DELAY_TIME*3
+    );
+    
+    // schedule 2nd call 
+    sysq.scheduleCall(
+        boost::bind(&SystemQueueTest::OrderedCall, this, 2),
+                    DELAY_TIME*1
+    );
+    
+    // schedule 3rd call 
+    sysq.scheduleCall(
+        boost::bind(&SystemQueueTest::OrderedCall, this, 3),
+                    DELAY_TIME*2
+    );
+
+    // schedule 1st call (without delay)
+    sysq.scheduleCall(
+        boost::bind(&SystemQueueTest::OrderedCall, this, 1)
+    );
+    
+    
+    // XXX the usual bug..
+    sysq.scheduleCall(
+        boost::bind(&SystemQueueTest::Check, this),
+                    DELAY_TIME*4
+    );
+
+    // noting to do until the delay is up..
+    usleep(DELAY_TIME*4 + DELAY_MARGIN*100);  // XXX margin too high
+    
+    // wait for the event to happen
+    wait_for_checkmark(MAX_WAIT);
+    
+    // evaluation
+    EXPECT_EQ( 4, last_ordered_call);
+}
