From db8cfa37e38563c0f523b02bb144543157427621 Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Wed, 17 Dec 2008 08:39:17 -0600 Subject: [PATCH] bug 2824: improving error messages from test suite errors This patch adds two warning messages to places in the test suite that may fail. I don't think it changes any functionality, but it sure makes it easier to figure out what has gone wrong. Signed-off-by: Galen Charlton --- t/lib/KohaTest.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/t/lib/KohaTest.pm b/t/lib/KohaTest.pm index 544444a5db..887eea415b 100644 --- a/t/lib/KohaTest.pm +++ b/t/lib/KohaTest.pm @@ -698,7 +698,10 @@ sub drop_all_foreign_keys { if ($id) { # we have found 1 foreign, drop it $dbh->do("ALTER TABLE $table DROP FOREIGN KEY $id"); - $id=""; + if ( $dbh->err ) { + diag "unable to DROP FOREIGN KEY '$id' on TABLE '$table' due to: " . $dbh->errstr(); + } + undef $id; } } } @@ -706,6 +709,9 @@ sub drop_all_foreign_keys { sub drop_table { my ($dbh, $table) = @_; $dbh->do("DROP TABLE $table"); + if ( $dbh->err ) { + diag "unable to drop table: '$table' due to: " . $dbh->errstr(); + } } =head3 create_test_database -- 2.39.5