Skip to content

Commit

Permalink
testapi: Adapt check_screen timeout default to proposal in documentation
Browse files Browse the repository at this point in the history
The doc string of the method check_screen already suggested to use a timeout
of 0 seconds for a long time. This change adjusts the timeout to a default of
0 seconds. This can be considered a breaking change :)
  • Loading branch information
okurz committed May 24, 2018
1 parent 30f9688 commit f492064
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion isotovideo
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ BEGIN {

# this shall be an integer increased by every change of the API
# either to the worker or the tests
our $INTERFACE = 11;
our $INTERFACE = 12;

use bmwqemu;
use needle;
Expand Down
4 changes: 2 additions & 2 deletions testapi.pm
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,15 @@ can be replaced by C<assert_screen> with multiple tags using an C<ARRAYREF> in
combination with C<match_has_tag> or another synchronization call in before,
for example C<wait_screen_change> or C<wait_still_screen>.
Returns matched needle or C<undef> if timeout is hit. Default timeout is 30s.
Returns matched needle or C<undef> if timeout is hit. Default timeout is 0s.
=cut

sub check_screen {
my ($mustmatch) = shift;
my $timeout;
$timeout = shift if (@_ % 2);
my %args = (timeout => $timeout // $bmwqemu::default_timeout, @_);
my %args = (timeout => $timeout // 0, @_);
bmwqemu::log_call(mustmatch => $mustmatch, %args);
return _check_or_assert($mustmatch, 1, %args);
}
Expand Down

0 comments on commit f492064

Please sign in to comment.