From ea76e0e55fe6c17e406d9d0d07f08bd69f37bf28 Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Wed, 25 Apr 2018 11:27:07 +0200 Subject: [PATCH] TT#35607 Fix tests. Consider possible empty last page Change-Id: I71bd2009806371871d8e582e53afcf633a8539bc --- t/lib/Test/Collection.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/t/lib/Test/Collection.pm b/t/lib/Test/Collection.pm index b1efe1ddd0..f5ba4729e7 100644 --- a/t/lib/Test/Collection.pm +++ b/t/lib/Test/Collection.pm @@ -924,8 +924,10 @@ sub check_list_collection{ is($selfuri, $nexturi, $test_info_prefix."check _links.self.href of collection"); my $colluri = URI->new($selfuri); if( - ((!$self->NO_COUNT) && $list_collection->{total_count} && is_int($list_collection->{total_count}) && $list_collection->{total_count} > 0 ) - || !$self->ALLOW_EMPTY_COLLECTION){ + (!$self->NO_COUNT) + && ( + ( $list_collection->{total_count} && is_int($list_collection->{total_count}) && $list_collection->{total_count} > 0 ) + || !$self->ALLOW_EMPTY_COLLECTION)){ ok($list_collection->{total_count} > 0, $test_info_prefix."check 'total_count' of collection"); } @@ -954,7 +956,10 @@ sub check_list_collection{ } my $hal_name = $self->get_hal_name; - if(($list_collection->{total_count} && is_int($list_collection->{total_count}) && $list_collection->{total_count} > 0 ) || !$self->ALLOW_EMPTY_COLLECTION){ + if((!$self->NO_COUNT) + && ( + ($list_collection->{total_count} && is_int($list_collection->{total_count}) && $list_collection->{total_count} > 0 ) + || !$self->ALLOW_EMPTY_COLLECTION) ){ if (! ok(((ref $list_collection->{_links}->{$hal_name} eq "ARRAY" ) || (ref $list_collection->{_links}->{$hal_name} eq "HASH" ) ), $test_info_prefix."check if 'ngcp:".$self->name."' is array/hash-ref")) { diag($list_collection->{_links}->{$hal_name});