Permalink
Browse files

Adding unit test to make sure single stepping the simulation doesn't …

…lose events.
  • Loading branch information...
1 parent 2f856f0 commit cb428cefa27c0e83e626e29fbd65b9348a2651ed Jeff Rose committed Feb 28, 2007
Showing with 9 additions and 0 deletions.
  1. +9 −0 test/simulation_test.rb
View
@@ -80,6 +80,15 @@ def test_scheduler
assert_equal(10, consumer.received)
end
+ def test_single_step
+ num_items = 10
+ consumer = Consumer.new
+ producer = Producer.new(consumer.sid, num_items)
+
+ (num_items * 10).times {|i| @sim.run(i) }
+ assert_equal(10, consumer.received)
+ end
+
def test_data_set
# Test the regular data logging
file = File.expand_path(File.join(File.dirname(__FILE__), "output", "producer"))

0 comments on commit cb428ce

Please sign in to comment.