diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2014-02-12 10:12:04 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-02-12 22:30:55 +0100 |
commit | a3c8390d19593b1e5277d95bfb4ab206d4785150 (patch) | |
tree | 2eb4e5432f4f79a75589c03b1513b656879ebf9c /src/tests/resolv-tests.c | |
parent | cc026fd9ba386f2197e3217940d597dcad1a26fe (diff) | |
download | sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.gz sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.xz sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.zip |
Make DEBUG macro invocations variadic
Use a script to update DEBUG macro invocations to use it as a variadic
macro, supplying format string and its arguments directly, instead of
wrapping them in parens.
This script was used to update the code:
grep -rwl --include '*.[hc]' DEBUG . |
while read f; do
mv "$f"{,.orig}
perl -e \
'use strict;
use File::Slurp;
my $text=read_file(\*STDIN);
$text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs;
print $text;' < "$f.orig" > "$f"
rm "$f.orig"
done
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'src/tests/resolv-tests.c')
-rw-r--r-- | src/tests/resolv-tests.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/tests/resolv-tests.c b/src/tests/resolv-tests.c index 8fde675f4..eb54e2c2c 100644 --- a/src/tests/resolv-tests.c +++ b/src/tests/resolv-tests.c @@ -273,11 +273,11 @@ static void test_ip_addr(struct tevent_req *req) &status, NULL, &rhostent); talloc_zfree(req); if (recv_status != EOK) { - DEBUG(2, ("resolv_gethostbyname_recv failed: %d\n", recv_status)); + DEBUG(2, "resolv_gethostbyname_recv failed: %d\n", recv_status); test_ctx->error = recv_status; return; } - DEBUG(7, ("resolv_gethostbyname_recv status: %d\n", status)); + DEBUG(7, "resolv_gethostbyname_recv status: %d\n", status); test_ctx->error = ENOENT; for (i = 0; rhostent->addr_list[i]; i++) { @@ -310,7 +310,7 @@ START_TEST(test_resolv_ip_addr) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_ONLY, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { ret = ENOMEM; } @@ -342,11 +342,11 @@ static void test_localhost(struct tevent_req *req) &status, NULL, &rhostent); talloc_zfree(req); if (recv_status != EOK) { - DEBUG(2, ("resolv_gethostbyname_recv failed: %d\n", recv_status)); + DEBUG(2, "resolv_gethostbyname_recv failed: %d\n", recv_status); test_ctx->error = recv_status; return; } - DEBUG(7, ("resolv_gethostbyname_recv status: %d\n", status)); + DEBUG(7, "resolv_gethostbyname_recv status: %d\n", status); test_ctx->error = ENOENT; for (i = 0; rhostent->addr_list[i]; i++) { @@ -379,7 +379,7 @@ START_TEST(test_resolv_localhost) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { ret = ENOMEM; } @@ -410,12 +410,12 @@ static void test_negative(struct tevent_req *req) &status, NULL, &hostent); talloc_zfree(req); if (recv_status == EOK) { - DEBUG(7, ("resolv_gethostbyname_recv succeeded in a negative test\n")); + DEBUG(7, "resolv_gethostbyname_recv succeeded in a negative test\n"); return; } test_ctx->error = status; - DEBUG(2, ("resolv_gethostbyname_recv status: %d: %s\n", status, resolv_strerror(status))); + DEBUG(2, "resolv_gethostbyname_recv status: %d: %s\n", status, resolv_strerror(status)); } START_TEST(test_resolv_negative) @@ -435,7 +435,7 @@ START_TEST(test_resolv_negative) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { ret = ENOMEM; } @@ -482,8 +482,8 @@ static void test_internet(struct tevent_req *req) inet_ntop(rhostent->family, rhostent->addr_list[i]->ipaddr, addr_buf, sizeof(addr_buf)); - DEBUG(2, ("Found address %s with TTL %d\n", - addr_buf, rhostent->addr_list[i]->ttl)); + DEBUG(2, "Found address %s with TTL %d\n", + addr_buf, rhostent->addr_list[i]->ttl); } } break; @@ -492,7 +492,7 @@ static void test_internet(struct tevent_req *req) &txt_replies); test_ctx->error = (txt_replies == NULL) ? ENOENT : EOK; for (txtptr = txt_replies; txtptr != NULL; txtptr = txtptr->next) { - DEBUG(2, ("TXT Record: %s\n", txtptr->txt)); + DEBUG(2, "TXT Record: %s\n", txtptr->txt); } break; case TESTING_SRV: @@ -500,9 +500,9 @@ static void test_internet(struct tevent_req *req) &srv_replies); test_ctx->error = (srv_replies == NULL) ? ENOENT : EOK; for (srvptr = srv_replies; srvptr != NULL; srvptr = srvptr->next) { - DEBUG(2, ("SRV Record: %d %d %d %s\n", srvptr->weight, + DEBUG(2, "SRV Record: %d %d %d %s\n", srvptr->weight, srvptr->priority, srvptr->port, - srvptr->host)); + srvptr->host); } break; default: @@ -511,7 +511,7 @@ static void test_internet(struct tevent_req *req) } talloc_zfree(req); fail_if(recv_status != EOK, "The recv function failed: %d", recv_status); - DEBUG(7, ("recv status: %d\n", status)); + DEBUG(7, "recv status: %d\n", status); if (rhostent != NULL) { talloc_free(rhostent); @@ -541,7 +541,7 @@ START_TEST(test_resolv_internet) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { ret = ENOMEM; } @@ -612,7 +612,7 @@ static void resolv_free_context(struct tevent_context *ev, struct timeval t, void *ptr) { struct resolv_ctx *rctx = talloc_get_type(ptr, struct resolv_ctx); - DEBUG(7, ("freeing the context\n")); + DEBUG(7, "freeing the context\n"); talloc_free(rctx); } @@ -622,7 +622,7 @@ static void resolv_free_done(struct tevent_context *ev, struct timeval t, void *ptr) { struct resolv_test_ctx *tctx = talloc_get_type(ptr, struct resolv_test_ctx); - DEBUG(7, ("marking test as done\n")); + DEBUG(7, "marking test as done\n"); tctx->error = EOK; tctx->done = true; @@ -646,7 +646,7 @@ START_TEST(test_resolv_free_context) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { fail("Error calling resolv_gethostbyname_send"); goto done; @@ -683,7 +683,7 @@ static void resolv_free_req(struct tevent_context *ev, struct timeval t, void *ptr) { struct tevent_req *req = talloc_get_type(ptr, struct tevent_req); - DEBUG(7, ("freeing the request\n")); + DEBUG(7, "freeing the request\n"); talloc_free(req); } @@ -794,7 +794,7 @@ START_TEST(test_resolv_free_req) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { fail("Error calling resolv_gethostbyname_send"); goto done; @@ -871,7 +871,7 @@ START_TEST(test_resolv_timeout) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { ret = ENOMEM; } |