From owner-svn-src-all@FreeBSD.ORG Mon Oct 13 02:28:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37039B1E; Mon, 13 Oct 2014 02:28:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23531A7A; Mon, 13 Oct 2014 02:28:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9D2S0R8033531; Mon, 13 Oct 2014 02:28:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9D2RxSb033529; Mon, 13 Oct 2014 02:27:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201410130227.s9D2RxSb033529@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 13 Oct 2014 02:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273021 - head/contrib/netbsd-tests/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 02:28:00 -0000 Author: ngie Date: Mon Oct 13 02:27:59 2014 New Revision: 273021 URL: https://svnweb.freebsd.org/changeset/base/273021 Log: Use 1 as a random seed, as recommended in srandom(3). Adjust the random values accordingly Submitted by: pho Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Modified: head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Mon Oct 13 02:23:24 2014 (r273020) +++ head/contrib/netbsd-tests/lib/libc/string/t_memcpy.c Mon Oct 13 02:27:59 2014 (r273021) @@ -51,7 +51,11 @@ unsigned char *start[BLOCKTYPES] = { }; char result[100]; +#if defined(__NetBSD__) const char goodResult[] = "7b405d24bc03195474c70ddae9e1f8fb"; +#else +const char goodResult[] = "217b4fbe456916bf62a2f85df752e4ab"; +#endif static void runTest(unsigned char *b1, unsigned char *b2) @@ -89,7 +93,15 @@ ATF_TC_BODY(memcpy_basic, tc) start[2] = auto1; start[3] = auto2; +#if defined(__NetBSD__) srandom(0L); +#else + /* + * random() shall produce by default a sequence of numbers that can be + * duplicated by calling srandom() with 1 as the seed. + */ + srandom(1); +#endif MD5Init(mc); for (i = 0; i < BLOCKTYPES; ++i) for (j = 0; j < BLOCKTYPES; ++j)