From a008bd81dcae389b674370fde06b45e7cc2acd42 Mon Sep 17 00:00:00 2001
From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Date: Fri, 23 Oct 2015 13:40:45 -0300
Subject: [PATCH] Bug 14468: followup to fix tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch fix an expected  test result.
Also changes a comparison for the return value to 'delete'
layout sub, in case of success it returns 'undef' and triggers
the message 'use of uninitialized value $del_results ...'

To test:
1) Whitout this patch

prove t/db_dependent/Labels/t_Layout.t

fails.

Also note the message
"Use of uninitialized value $del_results in string ne at t/db_dependent/Labels/t_Layout.t line 110."
for using the return value of delete layout (undef on success!)

2) Apply the patch
3) Test pass and no more message

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
---
 t/db_dependent/Labels/t_Layout.t | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/db_dependent/Labels/t_Layout.t b/t/db_dependent/Labels/t_Layout.t
index 86f57a6..87db848 100644
--- a/t/db_dependent/Labels/t_Layout.t
+++ b/t/db_dependent/Labels/t_Layout.t
@@ -102,11 +102,11 @@ my $updated_layout = C4::Labels::Layout->retrieve(layout_id => $sav_results);
 is_deeply($updated_layout, $saved_layout, "Updated layout object is the expected");
 
 # Testing Layout->get_text_wrap_cols()
-is($updated_layout->get_text_wrap_cols(label_width => 180, left_text_margin => 18), 23,
+is($updated_layout->get_text_wrap_cols(label_width => 180, left_text_margin => 18), 21,
     "Layout->get_text_wrap_cols()");
 
 # Testing Layout->delete()
 my $del_results = $updated_layout->delete();
-ok($del_results ne -1, "Layout->delete() success");
+ok( ! defined($del_results) , "Layout->delete() success");
 
 1;
-- 
2.1.0