develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35434 - trunk/t/codingstd

From:
cotto
Date:
January 12, 2009 04:20
Subject:
[svn:parrot] r35434 - trunk/t/codingstd
Message ID:
20090112122029.8736ECB9F9@x12.develooper.com
Author: cotto
Date: Mon Jan 12 04:20:28 2009
New Revision: 35434

Modified:
   trunk/t/codingstd/c_arg_assert.t

Log:
[t] make arg assert test's diagnostic output more useful


Modified: trunk/t/codingstd/c_arg_assert.t
==============================================================================
--- trunk/t/codingstd/c_arg_assert.t	(original)
+++ trunk/t/codingstd/c_arg_assert.t	Mon Jan 12 04:20:28 2009
@@ -46,7 +46,7 @@
         my @lines = ($file->read());
         foreach my $line (@lines) {
             if($line =~ /^#define ASSERT_ARGS_([_a-zA-Z0-9]+)\s/s) {
-                push(@defines, $1);
+                push(@defines, [$1, $path] );
             }
             if($line =~ /^\s+ASSERT_ARGS\(([_a-zA-Z0-9]+)\)$/) {
                 my $func = $1;
@@ -60,12 +60,12 @@
     }
 
     # next, cross reference them.
-    my @missing = grep { !exists($usages{$_}) } @defines;
+    my @missing = grep { !exists($usages{$_->[0]}) } @defines;
     ok(!scalar @missing);
     if(scalar @missing) {
         diag("unused assert macros found:");
         foreach my $missing (sort @missing) {
-            diag($missing);
+            diag($missing->[1] . ": " . $missing->[0]);
         }
         diag(scalar(@missing) . " unused assert macros found in total.");
     }



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About