From 83bf46f4066e3d5e838a32357c201de9bd6ecdfd Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Wed, 12 Feb 2014 10:12:59 -0500 Subject: Update DEBUG* invocations to use new levels Use a script to update DEBUG* macro invocations, which use literal numbers for levels, to use bitmask macros instead: grep -rl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e 'use strict; use File::Slurp; my @map=qw" SSSDBG_FATAL_FAILURE SSSDBG_CRIT_FAILURE SSSDBG_OP_FAILURE SSSDBG_MINOR_FAILURE SSSDBG_CONF_SETTINGS SSSDBG_FUNC_DATA SSSDBG_TRACE_FUNC SSSDBG_TRACE_LIBS SSSDBG_TRACE_INTERNAL SSSDBG_TRACE_ALL "; my $text=read_file(\*STDIN); my $repl; $text=~s/ ^ ( .* \b (DEBUG|DEBUG_PAM_DATA|DEBUG_GR_MEM) \s* \(\s* )( [0-9] )( \s*, ) ( \s* ) ( .* ) $ / $repl = $1.$map[$3].$4.$5.$6, length($repl) <= 80 ? $repl : $1.$map[$3].$4."\n".(" " x length($1)).$6 /xmge; print $text; ' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek Reviewed-by: Stephen Gallagher Reviewed-by: Simo Sorce --- src/tests/files-tests.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/tests/files-tests.c') diff --git a/src/tests/files-tests.c b/src/tests/files-tests.c index 8e1ac0c9d..2a0e7ce41 100644 --- a/src/tests/files-tests.c +++ b/src/tests/files-tests.c @@ -64,14 +64,14 @@ static void teardown_files_test(void) cmd = talloc_asprintf(test_ctx, "/bin/rm -rf %s\n", dir_path); ret = system(cmd); if (ret == -1) { - DEBUG(1, "Removing [%s] failed.\n", dir_path); + DEBUG(SSSDBG_CRIT_FAILURE, "Removing [%s] failed.\n", dir_path); } } if (dst_path && test_ctx) { cmd = talloc_asprintf(test_ctx, "/bin/rm -rf %s\n", dst_path); ret = system(cmd); if (ret == -1) { - DEBUG(1, "Removing [%s] failed.\n", dst_path); + DEBUG(SSSDBG_CRIT_FAILURE, "Removing [%s] failed.\n", dst_path); } } @@ -109,7 +109,7 @@ START_TEST(test_remove_tree) fail_unless(getcwd(origpath, PATH_MAX) == origpath, "Cannot getcwd\n"); fail_unless(errno == 0, "Cannot getcwd\n"); - DEBUG(5, "About to delete %s\n", dir_path); + DEBUG(SSSDBG_FUNC_DATA, "About to delete %s\n", dir_path); /* create a file */ ret = chdir(dir_path); @@ -182,7 +182,8 @@ START_TEST(test_simple_copy) fail_if(ret == -1, "Cannot chdir\n"); /* and finally copy.. */ - DEBUG(5, "Will copy from '%s' to '%s'\n", dir_path, dst_path); + DEBUG(SSSDBG_FUNC_DATA, + "Will copy from '%s' to '%s'\n", dir_path, dst_path); ret = copy_tree(dir_path, dst_path, 0700, uid, gid); fail_unless(ret == EOK, "copy_tree failed\n"); @@ -224,7 +225,8 @@ START_TEST(test_copy_symlink) fail_if(ret == -1, "Cannot chdir\n"); /* and finally copy.. */ - DEBUG(5, "Will copy from '%s' to '%s'\n", dir_path, dst_path); + DEBUG(SSSDBG_FUNC_DATA, + "Will copy from '%s' to '%s'\n", dir_path, dst_path); ret = copy_tree(dir_path, dst_path, 0700, uid, gid); fail_unless(ret == EOK, "copy_tree failed\n"); @@ -262,7 +264,8 @@ START_TEST(test_copy_node) fail_if(ret == -1, "Cannot chdir\n"); /* and finally copy.. */ - DEBUG(5, "Will copy from '%s' to '%s'\n", dir_path, dst_path); + DEBUG(SSSDBG_FUNC_DATA, + "Will copy from '%s' to '%s'\n", dir_path, dst_path); ret = copy_tree(dir_path, dst_path, 0700, uid, gid); fail_unless(ret == EOK, "copy_tree failed\n"); -- cgit