afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-09-07 11:29 am

[dw-free] Many tests in t/ fail

[commit: http://hg.dwscoalition.org/dw-free/rev/c29700bccea5]

http://bugs.dwscoalition.org/show_bug.cgi?id=1721

Remove many warnings.

Patch by [personal profile] szabgab.

Files modified:
  • cgi-bin/DW/User/ContentFilters/Filter.pm
  • cgi-bin/LJ/Comment.pm
  • cgi-bin/cleanhtml.pl
  • t/atom-post.t
--------------------------------------------------------------------------------
diff -r 1d13e7e71e13 -r c29700bccea5 cgi-bin/DW/User/ContentFilters/Filter.pm
--- a/cgi-bin/DW/User/ContentFilters/Filter.pm	Sun Sep 06 18:22:55 2009 +0000
+++ b/cgi-bin/DW/User/ContentFilters/Filter.pm	Mon Sep 07 11:28:30 2009 +0000
@@ -134,9 +134,9 @@ sub data {
 
     # try memcache second
     my $u = $self->owner;
-    my $data = $u->memc_get( 'cfd:' . $self->id );
-    return $self->{_data} = $data
-        if $data;
+    my $mem_data = $u->memc_get( 'cfd:' . $self->id );
+    return $self->{_data} = $mem_data
+        if $mem_data;
 
     # fall back to the database
     my $data = $u->selectrow_array(
diff -r 1d13e7e71e13 -r c29700bccea5 cgi-bin/LJ/Comment.pm
--- a/cgi-bin/LJ/Comment.pm	Sun Sep 06 18:22:55 2009 +0000
+++ b/cgi-bin/LJ/Comment.pm	Mon Sep 07 11:28:30 2009 +0000
@@ -75,6 +75,9 @@ sub instance {
     $self->{journalid} = LJ::want_userid($uuserid) or
         croak("invalid journalid parameter");
 
+    no warnings 'uninitialized';
+    # because $opts{jtalkid} and $opts{dtalkid} can be undef
+    # and int() warns on those
     $self->{jtalkid} = int(delete $opts{jtalkid});
 
     if (my $dtalkid = int(delete $opts{dtalkid})) {
diff -r 1d13e7e71e13 -r c29700bccea5 cgi-bin/cleanhtml.pl
--- a/cgi-bin/cleanhtml.pl	Sun Sep 06 18:22:55 2009 +0000
+++ b/cgi-bin/cleanhtml.pl	Mon Sep 07 11:28:30 2009 +0000
@@ -179,7 +179,7 @@ sub clean
         foreach (@{$opts->{'attrstrip'}}) { push @attrstrip, $_; }
     }
 
-    my %opencount = ();
+    my %opencount = map {$_ => 0} qw(td th);
     my @tablescope = ();
 
     my $cutcount = 0;
diff -r 1d13e7e71e13 -r c29700bccea5 t/atom-post.t
--- a/t/atom-post.t	Sun Sep 06 18:22:55 2009 +0000
+++ b/t/atom-post.t	Mon Sep 07 11:28:30 2009 +0000
@@ -36,10 +36,12 @@ ok($EditURI, "got an edit URI back, pres
 ok($EditURI, "got an edit URI back, presumably posted");
 like($EditURI, qr!/atom/edit/1$!, "got the right URI back");
 
-my $entry = LJ::Entry->new($u, jitemid => 1);
-ok($entry, "got entry");
-ok($entry->valid, "entry is valid")
-    or die "rest will fail";
+{
+    my $entry = LJ::Entry->new($u, jitemid => 1);
+    ok($entry, "got entry");
+    ok($entry->valid, "entry is valid")
+        or die "rest will fail";
 
-is($entry->event_raw, $content, "item has right content");
+    is($entry->event_raw, $content, "item has right content");
+}
 
--------------------------------------------------------------------------------