From owner-p4-projects@FreeBSD.ORG Sun Jul 2 17:15:00 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 200F816A47C; Sun, 2 Jul 2006 17:15:00 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAE6B16A403 for ; Sun, 2 Jul 2006 17:14:59 +0000 (UTC) (envelope-from bushman@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF8E844562 for ; Sun, 2 Jul 2006 17:14:54 +0000 (GMT) (envelope-from bushman@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k62HEs2f045932 for ; Sun, 2 Jul 2006 17:14:54 GMT (envelope-from bushman@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k62HEsX0045929 for perforce@freebsd.org; Sun, 2 Jul 2006 17:14:54 GMT (envelope-from bushman@freebsd.org) Date: Sun, 2 Jul 2006 17:14:54 GMT Message-Id: <200607021714.k62HEsX0045929@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bushman@freebsd.org using -f From: Michael Bushkov To: Perforce Change Reviews Cc: Subject: PERFORCE change 100440 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jul 2006 17:15:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=100440 Change 100440 by bushman@bushman_nss_ldap_cached on 2006/07/02 17:14:31 testutil.h small style fixes. test-gethostby (for gethostby***() functions) added - not fully functional yet. Affected files ... .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/nss/Makefile#4 edit .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/nss/test-gethostby.c#1 add .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/nss/test-gethostby.t#1 add .. //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/nss/testutil.h#6 edit Differences ... ==== //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/nss/Makefile#4 (text+ko) ==== @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTS= test-getpw test-getgr test-getserv +TESTS= test-getpw test-getgr test-gethostby test-getserv CFLAGS+= -g -Wall .PHONY: tests ==== //depot/projects/soc2006/nss_ldap_cached/src/tools/regression/lib/libc/nss/testutil.h#6 (text+ko) ==== @@ -41,15 +41,15 @@ STAILQ_HEAD(ent_head, ent##_entry) snapshot_data; \ }; \ \ -void __##ent##_test_data_init(struct ent##_test_data *, \ +void __##ent##_test_data_init(struct ent##_test_data *, \ void (*)(struct ent *, struct ent const *), \ void (*freef)(struct ent *)); \ void __##ent##_test_data_destroy(struct ent##_test_data *); \ \ void __##ent##_test_data_append(struct ent##_test_data *, struct ent *data);\ -int __##ent##_test_data_foreach(struct ent##_test_data *, int (*)(struct ent *,\ - void *), void *); \ -int __##ent##_test_data_compare(struct ent##_test_data *, \ +int __##ent##_test_data_foreach(struct ent##_test_data *, \ + int (*)(struct ent *, void *), void *); \ +int __##ent##_test_data_compare(struct ent##_test_data *, \ struct ent##_test_data *, int (*)(struct ent *, struct ent *, \ void *), void *); \ struct ent *__##ent##_test_data_find(struct ent##_test_data *, struct ent *,\ @@ -69,8 +69,8 @@ #define TEST_DATA_CLEAR(ent, td) __##ent##_test_data_clear(td) #define IMPLEMENT_TEST_DATA(ent) \ -void \ -__##ent##_test_data_init(struct ent##_test_data *td, \ +void \ +__##ent##_test_data_init(struct ent##_test_data *td, \ void (*clonef)(struct ent *, struct ent const *), \ void (*freef)(struct ent *)) \ { \ @@ -84,14 +84,14 @@ STAILQ_INIT(&td->snapshot_data); \ } \ \ -void \ -__##ent##_test_data_destroy(struct ent##_test_data *td) \ +void \ +__##ent##_test_data_destroy(struct ent##_test_data *td) \ { \ - __##ent##_test_data_clear(td); \ + __##ent##_test_data_clear(td); \ } \ \ -void \ -__##ent##_test_data_append(struct ent##_test_data *td, struct ent *app_data) \ +void \ +__##ent##_test_data_append(struct ent##_test_data *td, struct ent *app_data)\ { \ struct ent##_entry *e; \ \ @@ -106,8 +106,8 @@ STAILQ_INSERT_TAIL(&td->snapshot_data, e, entries); \ } \ \ -int \ -__##ent##_test_data_foreach(struct ent##_test_data *td, \ +int \ +__##ent##_test_data_foreach(struct ent##_test_data *td, \ int (*forf)(struct ent *, void *), void *mdata) \ { \ struct ent##_entry *e; \ @@ -126,7 +126,7 @@ return (rv); \ } \ \ -int \ +int \ __##ent##_test_data_compare(struct ent##_test_data *td1, struct ent##_test_data *td2,\ int (*cmp_func)(struct ent *, struct ent *, void *), void *mdata)\ { \ @@ -157,8 +157,8 @@ return (rv); \ } \ \ -struct ent * \ -__##ent##_test_data_find(struct ent##_test_data *td, struct ent *data, \ +struct ent * \ +__##ent##_test_data_find(struct ent##_test_data *td, struct ent *data, \ int (*cmp)(struct ent *, struct ent *, void *), void *mdata) \ { \ struct ent##_entry *e; \ @@ -179,8 +179,8 @@ } \ \ \ -void \ -__##ent##_test_data_clear(struct ent##_test_data *td) \ +void \ +__##ent##_test_data_clear(struct ent##_test_data *td) \ { \ struct ent##_entry *e; \ assert(td != NULL); \ @@ -201,20 +201,20 @@ void (*sdump_func)(struct ent *, char *, size_t); \ }; \ \ -int __##ent##_snapshot_write_func(struct ent *, void *); \ +int __##ent##_snapshot_write_func(struct ent *, void *); \ int __##ent##_snapshot_write(char const *, struct ent##_test_data *, \ void (*)(struct ent *, char *, size_t)); \ int __##ent##_snapshot_read(char const *, struct ent##_test_data *, \ int (*)(struct ent *, char *)); -#define TEST_SNAPSHOT_FILE_WRITE(ent, fname, td, f)\ +#define TEST_SNAPSHOT_FILE_WRITE(ent, fname, td, f) \ __##ent##_snapshot_write(fname, td, f) -#define TEST_SNAPSHOT_FILE_READ(ent, fname, td, f)\ +#define TEST_SNAPSHOT_FILE_READ(ent, fname, td, f) \ __##ent##_snapshot_read(fname, td, f) -#define IMPLEMENT_TEST_FILE_SNAPSHOT(ent) \ -int \ -__##ent##_snapshot_write_func(struct ent *data, void *mdata) \ +#define IMPLEMENT_TEST_FILE_SNAPSHOT(ent) \ +int \ +__##ent##_snapshot_write_func(struct ent *data, void *mdata) \ { \ char buffer[1024]; \ struct ent##_snp_param *param; \ @@ -229,8 +229,8 @@ return (0); \ } \ \ -int \ -__##ent##_snapshot_write(char const *fname, struct ent##_test_data *td, \ +int \ +__##ent##_snapshot_write(char const *fname, struct ent##_test_data *td, \ void (*sdump_func)(struct ent *, char *, size_t)) \ { \ struct ent##_snp_param param; \ @@ -243,14 +243,14 @@ return (-1); \ \ param.sdump_func = sdump_func; \ - __##ent##_test_data_foreach(td, __##ent##_snapshot_write_func, ¶m); \ + __##ent##_test_data_foreach(td, __##ent##_snapshot_write_func, ¶m);\ fclose(param.fp); \ \ return (0); \ } \ \ -int \ -__##ent##_snapshot_read(char const *fname, struct ent##_test_data *td, \ +int \ +__##ent##_snapshot_read(char const *fname, struct ent##_test_data *td, \ int (*read_func)(struct ent *, char *)) \ { \ char buffer[1024]; \ @@ -279,7 +279,7 @@ \ rv = read_func(&data, s); \ if (rv == 0) { \ - __##ent##_test_data_append(td, &data); \ + __##ent##_test_data_append(td, &data); \ td->free_func(&data); \ } \ } \ @@ -292,20 +292,20 @@ #define DECLARE_1PASS_TEST(ent) \ int __##ent##_1pass_test(struct ent##_test_data *, \ - int (*)(struct ent *, void *), \ + int (*)(struct ent *, void *), \ void *); -#define DO_1PASS_TEST(ent, td, f, mdata)\ +#define DO_1PASS_TEST(ent, td, f, mdata) \ __##ent##_1pass_test(td, f, mdata) #define IMPLEMENT_1PASS_TEST(ent) \ -int \ -__##ent##_1pass_test(struct ent##_test_data *td, \ +int \ +__##ent##_1pass_test(struct ent##_test_data *td, \ int (*tf)(struct ent *, void *), \ void *mdata) \ { \ int rv; \ - rv = __##ent##_test_data_foreach(td, tf, mdata); \ + rv = __##ent##_test_data_foreach(td, tf, mdata); \ \ return (rv); \ } @@ -315,18 +315,18 @@ struct ent##_test_data *, \ int (*)(struct ent *, struct ent *, void *), void *); -#define DO_2PASS_TEST(ent, td1, td2, f, mdata)\ +#define DO_2PASS_TEST(ent, td1, td2, f, mdata) \ __##ent##_2pass_test(td1, td2, f, mdata) #define IMPLEMENT_2PASS_TEST(ent) \ -int \ -__##ent##_2pass_test(struct ent##_test_data *td1, \ +int \ +__##ent##_2pass_test(struct ent##_test_data *td1, \ struct ent##_test_data *td2, \ int (*cmp_func)(struct ent *, struct ent *, void *), \ void *cmp_mdata) \ { \ int rv; \ \ - rv = __##ent##_test_data_compare(td1, td2, cmp_func, cmp_mdata); \ + rv = __##ent##_test_data_compare(td1, td2, cmp_func, cmp_mdata); \ return (rv); \ }