From 0865ac7d67eab4639746d9e18ee02989870a430c Mon Sep 17 00:00:00 2001 From: jq Date: Mon, 21 May 2007 17:22:26 +0000 Subject: [PATCH] [project @ 6191] r4804@merlin: jquelin | 2007-05-21 18:34:21 +0200 tests for fade() event --- t/43-cmds-settings.t | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/t/43-cmds-settings.t b/t/43-cmds-settings.t index ae1fc27..79fcc32 100644 --- a/t/43-cmds-settings.t +++ b/t/43-cmds-settings.t @@ -28,29 +28,35 @@ use Test::More; my $volume; -our $nbtests = 8; +our $nbtests = 10; our @tests = ( # [ 'event', [ $arg1, $arg2, ... ], $answer_back, \&check_results ] # repeat - [ 'repeat', [1], $DISCARD, undef ], - [ 'status', [], $SEND, \&check_repeat_is_on ], - [ 'repeat', [0], $DISCARD, undef ], - [ 'status', [], $SEND, \&check_repeat_is_off ], - [ 'repeat', [], $SLEEP1, undef ], - [ 'status', [], $SEND, \&check_repeat_is_on ], - [ 'repeat', [], $SLEEP1, undef ], - [ 'status', [], $SEND, \&check_repeat_is_off ], + [ 'repeat', [1], $DISCARD, undef ], + [ 'status', [], $SEND, \&check_repeat_is_on ], + [ 'repeat', [0], $DISCARD, undef ], + [ 'status', [], $SEND, \&check_repeat_is_off ], + [ 'repeat', [], $SLEEP1, undef ], + [ 'status', [], $SEND, \&check_repeat_is_on ], + [ 'repeat', [], $SLEEP1, undef ], + [ 'status', [], $SEND, \&check_repeat_is_off ], # random - [ 'random', [1], $DISCARD, undef ], - [ 'status', [], $SEND, \&check_random_is_on ], - [ 'random', [0], $DISCARD, undef ], - [ 'status', [], $SEND, \&check_random_is_off ], - [ 'random', [], $SLEEP1, undef ], - [ 'status', [], $SEND, \&check_random_is_on ], - [ 'random', [], $SLEEP1, undef ], - [ 'status', [], $SEND, \&check_random_is_off ], + [ 'random', [1], $DISCARD, undef ], + [ 'status', [], $SEND, \&check_random_is_on ], + [ 'random', [0], $DISCARD, undef ], + [ 'status', [], $SEND, \&check_random_is_off ], + [ 'random', [], $SLEEP1, undef ], + [ 'status', [], $SEND, \&check_random_is_on ], + [ 'random', [], $SLEEP1, undef ], + [ 'status', [], $SEND, \&check_random_is_off ], + + # fade + [ 'fade', [15], $DISCARD, undef ], + [ 'status', [], $SEND, \&check_fade_is_on ], + [ 'fade', [], $DISCARD, undef ], + [ 'status', [], $SEND, \&check_fade_is_off ], ); # are we able to test module? @@ -64,3 +70,6 @@ sub check_repeat_is_off { is( $_[0]->data->repeat, 0, 'repeat is off' ); } sub check_random_is_on { is( $_[0]->data->random, 1, 'random is on' ); } sub check_random_is_off { is( $_[0]->data->random, 0, 'random is off' ); } +sub check_fade_is_on { is( $_[0]->data->xfade, 15, 'enabling fading' ); } +sub check_fade_is_off { is( $_[0]->data->xfade, 0, 'disabling fading by default' ); } + -- 2.11.4.GIT