ports/100749: New port: devel/p5-Test-MockRandom Replaces random number generation with non-random number generation

tjs tjs at cdpa.nsysu.edu.tw
Sun Jul 23 14:20:23 UTC 2006


>Number:         100749
>Category:       ports
>Synopsis:       New port: devel/p5-Test-MockRandom Replaces random number generation with non-random number generation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 23 14:20:09 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Jin-Shan Tseng
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
NCHC
>Environment:
System: FreeBSD Pluto.CDPA.nsysu.edu.tw 6.1-STABLE FreeBSD 6.1-STABLE #0: Mon Jul 17 12:45:19 CST 2006 tjs at Pluto.CDPA.nsysu.edu.tw:/usr/obj/usr/src/sys/Pluto i386


>Description:

This perhaps ridiculous-seeming module was created to test
routines that manipulate random numbers by providing a known
output from rand. Given a list of seeds with srand, it will
return each in turn. After seeded random numbers are
exhausted, it will always return 0. Seed numbers must be of
a form that meets the expected output from rand as called
with no arguments -- i.e. they must be between 0 (inclusive)
and 1 (exclusive). In order to facilitate generating and
testing a nearly-one number, this module exports the function
oneish, which returns a number just fractionally less than one.

Depending on how this module is called with use, it will
export rand to a specified package (e.g. a class being tested)
effectively overriding and intercepting calls in that package
to the built-in rand. It can also override rand in the current
package or even globally. In all of these cases, it also
exports srand and oneish to the current package in order to
control the output of rand. See "USAGE" for details.

Alternatively, this module can be used to generate objects,
with each object maintaining its own distinct seed array.

WWW:    http://search.cpan.org/dist/Test-MockRandom/

>How-To-Repeat:
>Fix:


--- p5-Test-MockRandom.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	p5-Test-MockRandom
#	p5-Test-MockRandom/Makefile
#	p5-Test-MockRandom/distinfo
#	p5-Test-MockRandom/pkg-descr
#	p5-Test-MockRandom/pkg-plist
#
echo c - p5-Test-MockRandom
mkdir -p p5-Test-MockRandom > /dev/null 2>&1
echo x - p5-Test-MockRandom/Makefile
sed 's/^X//' >p5-Test-MockRandom/Makefile << 'END-of-p5-Test-MockRandom/Makefile'
X# New Ports Collection Makefile for:	p5-Test-MockRandom
X# Date created:				2006-07-23
X# Whom:					Jin-Shan Tseng <tjs at cdpa.nsysu.edu.tw>
X# $FreeBSD$
X
XPORTNAME=	Test-MockRandom
XPORTVERSION=	0.99
XCATEGORIES=	devel perl5
XMASTER_SITES=	${MASTER_SITE_PERL_CPAN}
XMASTER_SITE_SUBDIR=	Test
XPKGNAMEPREFIX=	p5-
X
XMAINTAINER=	tjs at cdpa.nsysu.edu.tw
XCOMMENT=	Replaces random number generation with non-random number generation
X
XBUILD_DEPENDS=	${SITE_PERL}/Module/Build.pm:${PORTSDIR}/devel/p5-Module-Build
X
XPERL_CONFIGURE=	yes
X
XMAN3=		Test::MockRandom.3
X
X.include <bsd.port.mk>
END-of-p5-Test-MockRandom/Makefile
echo x - p5-Test-MockRandom/distinfo
sed 's/^X//' >p5-Test-MockRandom/distinfo << 'END-of-p5-Test-MockRandom/distinfo'
XMD5 (Test-MockRandom-0.99.tar.gz) = 8852d9674c670d8309064c98f7b3e2a5
XSHA256 (Test-MockRandom-0.99.tar.gz) = 0978a6ddea5cfa76f22b1c1732020d7f8d4b5cf06246085442f9c96568dc226e
XSIZE (Test-MockRandom-0.99.tar.gz) = 17649
END-of-p5-Test-MockRandom/distinfo
echo x - p5-Test-MockRandom/pkg-descr
sed 's/^X//' >p5-Test-MockRandom/pkg-descr << 'END-of-p5-Test-MockRandom/pkg-descr'
XThis perhaps ridiculous-seeming module was created to test
Xroutines that manipulate random numbers by providing a known
Xoutput from rand. Given a list of seeds with srand, it will
Xreturn each in turn. After seeded random numbers are
Xexhausted, it will always return 0. Seed numbers must be of
Xa form that meets the expected output from rand as called
Xwith no arguments -- i.e. they must be between 0 (inclusive)
Xand 1 (exclusive). In order to facilitate generating and
Xtesting a nearly-one number, this module exports the function
Xoneish, which returns a number just fractionally less than one.
X
XDepending on how this module is called with use, it will
Xexport rand to a specified package (e.g. a class being tested)
Xeffectively overriding and intercepting calls in that package
Xto the built-in rand. It can also override rand in the current
Xpackage or even globally. In all of these cases, it also
Xexports srand and oneish to the current package in order to
Xcontrol the output of rand. See "USAGE" for details.
X
XAlternatively, this module can be used to generate objects,
Xwith each object maintaining its own distinct seed array.
X
XWWW:	http://search.cpan.org/dist/Test-MockRandom/
END-of-p5-Test-MockRandom/pkg-descr
echo x - p5-Test-MockRandom/pkg-plist
sed 's/^X//' >p5-Test-MockRandom/pkg-plist << 'END-of-p5-Test-MockRandom/pkg-plist'
X%%SITE_PERL%%/%%PERL_ARCH%%/auto/Test/MockRandom/.packlist
X%%SITE_PERL%%/Test/MockRandom.pm
X at dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Test/MockRandom
X at dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Test
X at dirrmtry %%SITE_PERL%%/Test
END-of-p5-Test-MockRandom/pkg-plist
exit
--- p5-Test-MockRandom.shar ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list