Author: petdance
Date: Thu Feb 21 18:25:39 2008
New Revision: 25970
Modified:
trunk/t/codingstd/c_macro_args.t
Log:
Allow brackets instead of parens around macro args
Modified: trunk/t/codingstd/c_macro_args.t
==============================================================================
--- trunk/t/codingstd/c_macro_args.t (original)
+++ trunk/t/codingstd/c_macro_args.t Thu Feb 21 18:25:39 2008
@@ -60,7 +60,8 @@
if ($definition ne "") {
foreach my $arg (split /\s*,\s*/, $args) {
# eliminate any properly formed usage of the macro arg
- $definition =~ s/\($arg\)//g;
+ $definition =~ s/\Q($arg)//g;
+ $definition =~ s/\Q[$arg]//g;
# Any remaining usage must be improper
if ($definition =~ m/\b$arg\b/) {
push (@defines, "$path: $macro has unwrapped arg:
$arg\n");
@@ -70,8 +71,9 @@
}
}
- ok( !scalar(@defines), 'unwrapped macro args' )
- or diag( scalar @defines . " unsafe macro args found:[EMAIL
PROTECTED]" );
+ my $ndefines = scalar @defines;
+ is( $ndefines, 0, 'Check for unwrapped macro arguments' )
+ or diag( "$ndefines unsafe macro args found:[EMAIL PROTECTED]'s
$ndefines of 'em!" );
}
# Local Variables: