Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/regress/lib/libc rpc/xdr test has been atf-ified



details:   https://anonhg.NetBSD.org/src/rev/01150c258314
branches:  trunk
changeset: 760581:01150c258314
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Jan 08 07:02:17 2011 +0000

description:
rpc/xdr test has been atf-ified

diffstat:

 regress/lib/libc/Makefile           |   4 +-
 regress/lib/libc/rpc/Makefile       |   5 --
 regress/lib/libc/rpc/Makefile.inc   |   4 -
 regress/lib/libc/rpc/xdr/Makefile   |  18 -------
 regress/lib/libc/rpc/xdr/testbits.x |  20 --------
 regress/lib/libc/rpc/xdr/xdrtest.c  |  89 -------------------------------------
 6 files changed, 2 insertions(+), 138 deletions(-)

diffs (168 lines):

diff -r 4fb970e320ec -r 01150c258314 regress/lib/libc/Makefile
--- a/regress/lib/libc/Makefile Sat Jan 08 07:00:17 2011 +0000
+++ b/regress/lib/libc/Makefile Sat Jan 08 07:02:17 2011 +0000
@@ -1,6 +1,6 @@
-#      $NetBSD: Makefile,v 1.76 2011/01/07 15:08:40 pgoyette Exp $
+#      $NetBSD: Makefile,v 1.77 2011/01/08 07:02:17 pgoyette Exp $
 
-SUBDIR+= citrus divrem getaddrinfo int_fmtio locale regex rpc
+SUBDIR+= citrus divrem getaddrinfo int_fmtio locale regex
 
 .include <bsd.own.mk>
 .include <bsd.sys.mk>
diff -r 4fb970e320ec -r 01150c258314 regress/lib/libc/rpc/Makefile
--- a/regress/lib/libc/rpc/Makefile     Sat Jan 08 07:00:17 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#      $NetBSD: Makefile,v 1.1 2001/02/18 21:57:16 bjh21 Exp $
-
-SUBDIR=        xdr
-
-.include <bsd.subdir.mk>
diff -r 4fb970e320ec -r 01150c258314 regress/lib/libc/rpc/Makefile.inc
--- a/regress/lib/libc/rpc/Makefile.inc Sat Jan 08 07:00:17 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-#      $NetBSD: Makefile.inc,v 1.1 2001/02/18 21:57:16 bjh21 Exp $
-#
-# do not install regression test programs
-proginstall::
diff -r 4fb970e320ec -r 01150c258314 regress/lib/libc/rpc/xdr/Makefile
--- a/regress/lib/libc/rpc/xdr/Makefile Sat Jan 08 07:00:17 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#      $NetBSD: Makefile,v 1.10 2003/08/01 17:04:00 lukem Exp $
-
-NOMAN=         # defined
-
-PROG=          xdrtest
-RPCSRCS=       testbits.x
-SRCS=          ${RPCSRCS:.x=_xdr.c} xdrtest.c
-DPSRCS=                ${RPCSRCS:.x=.h}
-CLEANFILES+=   ${RPCSRCS:.x=.h} ${RPCSRCS:.x=_xdr.c}
-CPPFLAGS+=     -I.
-RPC_INCS=      ${RPCSRCS:.x=.h}
-RPC_XDRFILES=  ${RPCSRCS:.x=_xdr.c}
-
-regress: ${PROG}
-       ./${PROG}
-
-.include <bsd.rpc.mk>
-.include <bsd.prog.mk>
diff -r 4fb970e320ec -r 01150c258314 regress/lib/libc/rpc/xdr/testbits.x
--- a/regress/lib/libc/rpc/xdr/testbits.x       Sat Jan 08 07:00:17 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-/*     $NetBSD: testbits.x,v 1.1 2002/02/10 13:22:58 bjh21 Exp $       */
-
-enum smallenum {
-       SE_ONE = 1,
-       SE_TWO = 2
-};
-
-enum medenum {
-       ME_NEG = -1234,
-       ME_ONE = 1,
-       ME_TWO = 2,
-       ME_MANY = 1234
-};
-
-enum bigenum {
-       BE_ONE = 1,
-       BE_TWO = 2,
-       BE_MANY = 1234,
-       BE_LOTS = 1234567
-};
diff -r 4fb970e320ec -r 01150c258314 regress/lib/libc/rpc/xdr/xdrtest.c
--- a/regress/lib/libc/rpc/xdr/xdrtest.c        Sat Jan 08 07:00:17 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*     $NetBSD: xdrtest.c,v 1.5 2006/05/10 19:07:22 mrg Exp $  */
-
-/*-
- * Copyright (c) 2001 Ben Harris
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <err.h>
-#include <stdio.h>
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <stdlib.h>
-
-#include "testbits.h"
-
-char xdrdata[] = {
-       0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* double 1.0 */
-       0x00, 0x00, 0x00, 0x01, /* enum smallenum SE_ONE */
-       0xff, 0xff, 0xfb, 0x2e, /* enum medenum ME_NEG */
-       0x00, 0x12, 0xd6, 0x87, /* enum bigenum BE_LOTS */
-};
-
-int
-main(int argc, char **argv)
-{
-       XDR x;
-       double d;
-       smallenum s;
-       medenum m;
-       bigenum b;
-       char newdata[sizeof(xdrdata)];
-
-       xdrmem_create(&x, xdrdata, sizeof(xdrdata), XDR_DECODE);
-       if (!xdr_double(&x, &d))
-               errx(1, "xdr_double DECODE failed.");
-       if (d != 1.0)
-               errx(1, "double 1.0 decoded as %g.", d);
-       if (!xdr_smallenum(&x, &s))
-               errx(1, "xdr_smallenum DECODE failed.");
-       if (s != SE_ONE)
-               errx(1, "SE_ONE decoded as %d.", s);
-       if (!xdr_medenum(&x, &m))
-               errx(1, "xdr_medenum DECODE failed.");
-       if (m != ME_NEG)
-               errx(1, "ME_NEG decoded as %d.", m);
-       if (!xdr_bigenum(&x, &b))
-               errx(1, "xdr_bigenum DECODE failed.");
-       if (b != BE_LOTS)
-               errx(1, "BE_LOTS decoded as %d.", b);
-       xdr_destroy(&x);
-
-       xdrmem_create(&x, newdata, sizeof(newdata), XDR_ENCODE);
-       if (!xdr_double(&x, &d))
-               errx(1, "xdr_double ENCODE failed.");
-       if (!xdr_smallenum(&x, &s))
-               errx(1, "xdr_smallenum ENCODE failed.");
-       if (!xdr_medenum(&x, &m))
-               errx(1, "xdr_medenum ENCODE failed.");
-       if (!xdr_bigenum(&x, &b))
-               errx(1, "xdr_bigenum ENCODE failed.");
-       if (memcmp(newdata, xdrdata, sizeof(xdrdata)) != 0)
-               errx(1, "xdr ENCODE result differs.");
-       xdr_destroy(&x);
-
-       exit(0);
-}



Home | Main Index | Thread Index | Old Index