diff options
Diffstat (limited to 'bin/fuzz.pl')
-rwxr-xr-x | bin/fuzz.pl | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/bin/fuzz.pl b/bin/fuzz.pl index b05f09d9fd6..6eb9163e125 100755 --- a/bin/fuzz.pl +++ b/bin/fuzz.pl @@ -708,7 +708,7 @@ sub check_for_push_and_pop () close (FILE); if ($disable == 0 && $push_count != $pop_count) { - print_error ("$file:$.: #pragma warning(push)/(pop) mismatch"); + print_error ("$file: #pragma warning(push)/(pop) mismatch"); } } else { @@ -717,6 +717,43 @@ sub check_for_push_and_pop () } } +# This test verifies that the same number of +# "ACE_VERSIONED_NAMESPACE_BEGIN_DECL" and +# "ACE_END_VERSIONED_NAMESPACE_DECL" macros are used in a given +# source file. +sub check_for_versioned_namespace_begin_end () +{ + print "Running versioned namespace begin/end test\n"; + foreach $file (@files_cpp, @files_inl, @files_h) { + my $begin_count = 0; + my $end_count = 0; + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/^\s*\w+_BEGIN_VERSIONED_NAMESPACE_DECL/) { + ++$begin_count; + } + if (/^\s*\w+_END_VERSIONED_NAMESPACE_DECL/) { + ++$end_count; + } + if ($begin_count > $end_count and /^\s*#\s*include\s*/) { + print_error ("$file:$.: #include directive within Versioned namespace block"); + } + } + + close (FILE); + + if ($begin_count != $end_count) { + print_error ("$file: Versioned namespace begin($begin_count)/end($end_count) mismatch"); + } + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + + # Check doxygen @file comments sub check_for_mismatched_filename () { @@ -1311,6 +1348,7 @@ if (!getopts ('cdhl:t:mv') || $opt_h) { check_for_tchar check_for_pre_and_post check_for_push_and_pop + check_for_versioned_namespace_begin_end check_for_mismatched_filename check_for_bad_run_test check_for_absolute_ace_wrappers @@ -1369,6 +1407,7 @@ check_for_preprocessor_comments () if ($opt_l >= 7); check_for_tchar () if ($opt_l >= 4); check_for_pre_and_post () if ($opt_l >= 4); check_for_push_and_pop () if ($opt_l >= 4); +check_for_versioned_namespace_begin_end () if ($opt_l >= 4); check_for_mismatched_filename () if ($opt_l >= 2); check_for_bad_run_test () if ($opt_l >= 6); check_for_absolute_ace_wrappers () if ($opt_l >= 3); @@ -1381,6 +1420,7 @@ check_for_include () if ($opt_l >= 5); check_for_non_bool_operators () if ($opt_l > 2); check_for_long_file_names () if ($opt_l > 1 ); + print "\nFuzz.pl - $errors error(s), $warnings warning(s)\n"; exit (1) if $errors > 0; |