'object' => $self
) ;
- ok( ref $event, 'plain event created' ) ;
+ ok( ref $event, 'plain - event created' ) ;
Stem::Event::start_loop() ;
my( $self ) = @_ ;
- ok( 1, 'plain event triggered' ) ;
+ ok( 1, 'plain - event triggered' ) ;
}
sub test_signal_events {
'signal' => 'INT',
) ;
- ok( ref $event, 'signal event created' ) ;
+ ok( ref $event, 'signal - event created' ) ;
$self->{'sig_event'} = $event ;
my( $self ) = @_ ;
- ok( 1, 'signal event triggered' ) ;
+ ok( 1, 'signal - event triggered' ) ;
$self->{'sig_event'}->cancel() ;
Stem::Event::stop_loop() ;
'hard' => 1,
) ;
- ok( ref $event, 'hard timer event created' ) ;
+ ok( ref $event, 'hard timer - event created' ) ;
print "$event\n" unless ref $event ;
$self->{'hard_timer_event'} = $event ;
my( $self ) = @_ ;
- ok( 1, 'hard timer event triggered' ) ;
+ ok( 1, 'hard timer - event triggered' ) ;
if ( --$self->{'hard_timer_count'} > 0 ) {
my $delta = $time - $self->{'hard_timer_start_time'} ;
$self->{'hard_timer_start_time'} = $time ;
- ok( $delta >= INTERVAL, 'hard delta' ) ;
+ ok( $delta >= INTERVAL, 'hard timer - delta' ) ;
hard_sleep( SLEEP ) ;
#print "O $self->{'hard_timer_start_time'} T $time D $delta I ", INTERVAL, "\n" ;
- ok( $delta >= INTERVAL, 'hard delta 2' ) ;
- ok( $delta <= INTERVAL + SLEEP, 'hard delta sleep' ) ;
+ ok( $delta >= INTERVAL, 'hard timer - delta 2' ) ;
+ ok( $delta <= INTERVAL + SLEEP, 'hard timer - delta sleep' ) ;
$self->{'hard_timer_event'}->cancel() ;
'repeat' => 1,
) ;
- ok( ref $event, 'soft timer event created' ) ;
+ ok( ref $event, 'soft timer - event created' ) ;
# print "$event\n" unless ref $event ;
$self->{'soft_timer_event'} = $event ;
my( $self ) = @_ ;
- ok( 1, 'soft timer event triggered' ) ;
+ ok( 1, 'soft timer - event triggered' ) ;
if ( --$self->{'soft_timer_count'} > 0 ) {
#print "T $time D $delta I ", INTERVAL, "\n" ;
- ok( $delta >= INTERVAL, 'soft delta' ) ;
+ ok( $delta >= INTERVAL, 'soft timer - delta' ) ;
hard_sleep( SLEEP ) ;
#print "TIME2 $time OTIME $self->{'soft_timer_start_time'} DEL $delta INTERVAL ", INTERVAL, "\n" ;
-# ok( $delta >= INTERVAL, 'soft delta 2' ) ;
- ok( $delta >= INTERVAL + SLEEP, 'soft delta 3' ) ;
+# ok( $delta >= INTERVAL, 'soft timer - delta 2' ) ;
+ ok( $delta >= INTERVAL + SLEEP, 'soft timer - delta 3' ) ;
$self->{'soft_timer_event'}->cancel() ;
'timeout' => 3,
) ;
- ok( ref $read_event, 'read event created' ) ;
+ ok( ref $read_event, 'read - event created' ) ;
$self->{'read_event'} = $read_event ;
my $write_event = Stem::Event::Write->new(
'fh' => $write_fh,
) ;
- ok( ref $write_event, 'write event created' ) ;
+ ok( ref $write_event, 'write - event created' ) ;
$self->{'write_event'} = $write_event ;
Stem::Event::start_loop() ;
- ok( 1, 'io - event loop exit' ) ;
+ ok( 1, 'io event - loop exit' ) ;
}
sub read_timeout {
my( $self ) = @_ ;
- ok( 1, 'read event timed out' ) ;
+ ok( 1, 'read - event timed out' ) ;
$self->{'write_event'}->start() ;
}
my( $self ) = @_ ;
- ok( 1, 'write event triggered' ) ;
+ ok( 1, 'write - event triggered' ) ;
syswrite( $self->{'write_fh'}, $self->{'message'} ) ;
my( $self ) = @_ ;
- ok(1, 'read event triggered' ) ;
+ ok(1, 'read - event triggered' ) ;
my( $read_buf ) ;
my $bytes_read = sysread( $self->{'read_fh'}, $read_buf, 1000 ) ;
- ok( $bytes_read, 'read byte count' ) ;
+ ok( $bytes_read, 'read - byte count' ) ;
is( $read_buf, $self->{'message'}, 'read event compare' ) ;