From 42cadaaf1073dbebc02b295e2c9150783b0e994d Mon Sep 17 00:00:00 2001
From: Graham McVicker <mcvicker@sanger.ac.uk>
Date: Mon, 24 Mar 2003 11:50:20 +0000
Subject: [PATCH] cleaned up tests to avoid some warnings

---
 modules/t/TestUtils.pm    | 3 ++-
 modules/t/exon.t          | 2 +-
 modules/t/markerAdaptor.t | 2 +-
 modules/t/qtl.t           | 1 +
 modules/t/rawContig.t     | 3 +--
 modules/t/repeatFeature.t | 3 ---
 6 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/modules/t/TestUtils.pm b/modules/t/TestUtils.pm
index dc5d432d2a..d933a8b8f3 100644
--- a/modules/t/TestUtils.pm
+++ b/modules/t/TestUtils.pm
@@ -37,7 +37,8 @@ sub test_getter_setter {
     $object->$method($test_val);
     
     #verify value was set
-    $ret_val = ($object->$method eq $test_val);
+    $ret_val = (!defined($test_val) && !defined($object->$method)) || 
+	       ($object->$method eq $test_val);
 
     #restore the old value
     $object->$method($old_val);
diff --git a/modules/t/exon.t b/modules/t/exon.t
index 9bf6eb85d8..26e163bcc7 100644
--- a/modules/t/exon.t
+++ b/modules/t/exon.t
@@ -103,7 +103,7 @@ ok($exon->start == 30_961_059 && $exon->end == 30_961_259 && $exon->strand==1);
 #
 # Test transform to another slice
 #
-my $slice = $db->get_SliceAdaptor->fetch_by_chr_start_end($slice->chr_name, 
+$slice = $db->get_SliceAdaptor->fetch_by_chr_start_end($slice->chr_name,
 						   $exon->start - 10,
 						   $exon->end + 10);
 $exon = $exon->transform($slice);
diff --git a/modules/t/markerAdaptor.t b/modules/t/markerAdaptor.t
index 6cc991e75e..50d6748b5e 100644
--- a/modules/t/markerAdaptor.t
+++ b/modules/t/markerAdaptor.t
@@ -47,7 +47,7 @@ ok($marker->dbID == 1 &&
 my $markers = $marker_adaptor->fetch_all_by_synonym('D1S243');
 ok(scalar(@$markers) == 1 && 
    $markers->[0]->dbID == 1 &&
-   $markers->[0]->left_primer == $marker->left_primer);
+   $markers->[0]->left_primer eq $marker->left_primer);
 
 $markers = $marker_adaptor->fetch_all_by_synonym('Z16979', 'genbank');
 ok(scalar(@$markers == 1));
diff --git a/modules/t/qtl.t b/modules/t/qtl.t
index b8d3eea1d6..c65a1829f8 100644
--- a/modules/t/qtl.t
+++ b/modules/t/qtl.t
@@ -1,5 +1,6 @@
 use lib 't';
 use strict;
+use warnings;
 
 BEGIN { $| = 1;  
 	use Test ;
diff --git a/modules/t/rawContig.t b/modules/t/rawContig.t
index da59b1ec61..85fc774f9f 100755
--- a/modules/t/rawContig.t
+++ b/modules/t/rawContig.t
@@ -11,8 +11,6 @@ use TestUtils qw(debug);
 
 our $verbose = 0; #set to 1 for debug printing
 
-$loaded = 1;
-
 ok(1);
 
 my $multi = MultiTestDB->new();
@@ -96,6 +94,7 @@ my $a = $base_count->{'a'};
 my $c = $base_count->{'c'};
 my $t = $base_count->{'t'};
 my $g = $base_count->{'g'};
+my $n = $base_count->{'n'};
 my $gc_content = $base_count->{'%gc'};
 ok( $a == 6395 &&
     $c == 6070 &&
diff --git a/modules/t/repeatFeature.t b/modules/t/repeatFeature.t
index 60ec4140ed..2a2595ea5f 100644
--- a/modules/t/repeatFeature.t
+++ b/modules/t/repeatFeature.t
@@ -12,11 +12,8 @@ use TestUtils qw(test_getter_setter debug);
 our $verbose = 0;
 
 
-
 my $multi = MultiTestDB->new();
 
-$loaded = 1;
-
 ok(1);
 
 my $db = $multi->get_DBAdaptor( 'core' );
-- 
GitLab