comparison test/suite2_x86win32fast/rand.py @ 0:3e629dc19168

initial from svn dyncall-1745
author Daniel Adler
date Thu, 19 Mar 2015 22:24:28 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:3e629dc19168
1 #!/usr/bin/python
2 #//////////////////////////////////////////////////////////////////////////////
3 #
4 # Copyright (c) 2007,2009 Daniel Adler <dadler@uni-goettingen.de>,
5 # Tassilo Philipp <tphilipp@potion-studios.com>
6 #
7 # Permission to use, copy, modify, and distribute this software for any
8 # purpose with or without fee is hereby granted, provided that the above
9 # copyright notice and this permission notice appear in all copies.
10 #
11 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #
19 #//////////////////////////////////////////////////////////////////////////////
20
21
22 import random
23 import sys
24
25 N = 100
26 MINARG = 0
27 MAXARG = 19
28
29 argtypes = [ 'B','c','s','i','l','f','d','p' ]
30 apitypes = [ '_' ]
31
32 def sig(n):
33 s = ""
34 x = random.randint( 0, len(apitypes)-1 )
35 # s += apitypes[x]
36 for i in xrange(0,n):
37 x = random.randint( 0, len(argtypes)-1 )
38 s += argtypes[x]
39 return s
40
41 for i in xrange(0,N):
42 n = random.randint(MINARG,MAXARG)
43 sys.stdout.write( sig(n) )
44 sys.stdout.write( "\n" )
45