svn commit: samba r21688 - in branches/SAMBA_4_0: . source/lib/compression source/lib/util/tests source/torture/local

jelmer at samba.org jelmer at samba.org
Sun Mar 4 22:36:42 GMT 2007


Author: jelmer
Date: 2007-03-04 22:36:41 +0000 (Sun, 04 Mar 2007)
New Revision: 21688

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21688

Log:
Add simple tests for genrand
Added:
   branches/SAMBA_4_0/source/lib/compression/testsuite.c
   branches/SAMBA_4_0/source/lib/util/tests/genrand.c
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/torture/local/config.mk
   branches/SAMBA_4_0/source/torture/local/local.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:merge
   - jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
jelmer at samba.org-20061017145110-8c83a3dd979f6a6a
jelmer at samba.org-20061029173623-eb0459f1d3eb5720
jelmer at samba.org-20070115022006-h5ef1deqflt940b6
jelmer at samba.org-20070116142934-hv99dpwbnq2znh8f
jelmer at samba.org-20070116144126-70rip3bppmvgs3t6
jelmer at samba.org-20070116151516-imvui4r33cj850j9
jelmer at samba.org-20070116154739-3tji4fft7964qgrj
jelmer at samba.org-20070116173900-iasa25stcfty6pbr
jelmer at samba.org-20070117144550-te3o0iy10y14iyo4
jelmer at samba.org-20070122000024-q911packyrjk69ud
jelmer at samba.org-20070122181120-3n8ah238pjbzylyo
jelmer at samba.org-20070122182054-6b26fqrdqyjhyeuc
jelmer at samba.org-20070122233549-k085tfo2o1eqz7mm
jelmer at samba.org-20070123002251-0smz35eva10x84tc
jelmer at samba.org-20070123003546-p0jl6j9tw79q5j1k
jelmer at samba.org-20070123012404-o9w5pmgkm94zsxlu
jelmer at samba.org-20070123094731-ns7dzzzqtb0dlcod
jelmer at samba.org-20070125123431-g3pqm92r31ez9xyc
jelmer at samba.org-20070126125959-3w3t26aps9hmwukv
jelmer at samba.org-20070126132607-64kt7rc2wtqh0c7u
jelmer at samba.org-20070126133903-onfotbg1051ktojo
jelmer at samba.org-20070126144259-171b4t0744jigs5x
jelmer at samba.org-20070126152205-xj7j1avc7683rjy5
jelmer at samba.org-20070128010235-e8st47gcy00ii8kc
jelmer at samba.org-20070128130853-xjjrlrtf830pwnx6
jelmer at samba.org-20070130120806-gfqshokma9j6j3uv
jelmer at samba.org-20070131002510-55yxynmb1o4zvx0x
jelmer at samba.org-20070131115042-oocen3olfgu53jlm
jelmer at samba.org-20070206235608-980jutwyp43708k6
jelmer at samba.org-20070207185718-i1xx6bvmdeeii72p
jelmer at samba.org-20070208234639-i0h5mfefbn1a1lkl
jelmer at samba.org-20070209001154-lol5huzwdq9jw2e7
jelmer at samba.org-20070209093351-buzkh0t55nt863gw
jelmer at samba.org-20070212120516-lwfxtpxx1lerwro2
jelmer at samba.org-20070212130037-e7t2bh0ufajvi8m6
jelmer at samba.org-20070212173050-hpr37tn9ws2zhfko
jelmer at samba.org-20070214123932-nmsy6lnin8gtzxrn
jelmer at samba.org-20070214141810-0df8ykq1d0dl6yia
jelmer at samba.org-20070214143534-pc63vqrp827s6sdo
jelmer at samba.org-20070214145213-idzserezbwc2alty
jelmer at samba.org-20070214150805-zjdhqbtwy28fac3c
jelmer at samba.org-20070214192135-0yxxt5pto2lv4p4h
jelmer at samba.org-20070214213108-id4l0x9g95v6i060
jelmer at samba.org-20070215192824-a13ptx6qq150shoq
jelmer at samba.org-20070215210330-ve8q1mdkjymv6fr1
jelmer at samba.org-20070215220450-avh0rwc0ce0x7gja
jelmer at samba.org-20070215225539-cy8w0815ygz1wa0c
jelmer at samba.org-20070215234924-5u8bqtdp3ha66015
jelmer at samba.org-20070216003036-0ghop153wj46jjwe
jelmer at samba.org-20070216010504-03udexhmrhje5w5c
jelmer at samba.org-20070216124407-uwk21820sjr6n46p
jelmer at samba.org-20070216141029-nf84hlj2tr39ealw
jelmer at samba.org-20070216151123-m8lw5r1ebhymw8ba
jelmer at samba.org-20070217013108-znc8d1w6rtx0kaqf
jelmer at samba.org-20070217135603-92hi5qaxrxwoqulu
jelmer at samba.org-20070217233534-x58078kx0zci6831
jelmer at samba.org-20070218003055-80z3rswwe279yelu
jelmer at samba.org-20070218003815-07xijfqrcx3tybfi
jelmer at samba.org-20070218010222-fe4oase328jeg840
jelmer at samba.org-20070218115359-jytly04u0aufe8vn
jelmer at samba.org-20070218115806-9h8thqvb95iffgh5
jelmer at samba.org-20070218120236-9q5wvlctgevr438d
jelmer at samba.org-20070218120857-cg7f6ppc1b3jd2nj
jelmer at samba.org-20070218122007-5c147i8tk17nh31s
jelmer at samba.org-20070218125126-mq0gsnn6mdt0dr5p
jelmer at samba.org-20070218133855-zz8l3b16rc7rh5n9
jelmer at samba.org-20070218134908-r7jzuwppx6odzgao
jelmer at samba.org-20070218161231-qs4bbg2mkz3lo6rf
jelmer at samba.org-20070218164355-wcsqzlh7s37se8xk
jelmer at samba.org-20070218165112-edgr3gi0gg7aaqlj
jelmer at samba.org-20070218183655-2qk7xgjc222tls7y
jelmer at samba.org-20070218234351-nxjnkhl4bc4x00df
jelmer at samba.org-20070218235514-ziine4dmb38u0xv3
jelmer at samba.org-20070219004515-smmtdyy6deud4adv
jelmer at samba.org-20070219014759-jv5otc3ij03d89va
jelmer at samba.org-20070219192807-w8shsv06u698i3du
jelmer at samba.org-20070219212917-syg7v8ejwpfa8grh
jelmer at samba.org-20070219220607-f2xy405hjsim9l4p
jelmer at samba.org-20070219230825-to4yp0eswh2gd283
jelmer at samba.org-20070220012443-ky7aj0q1ra0t1ivl
jelmer at samba.org-20070220224521-cwtsy3lkbyppctj6
jelmer at samba.org-20070220231211-pizf7rowfbhdws2n
jelmer at samba.org-20070221102807-1eot92jt41ax1dg5
jelmer at samba.org-20070221103458-93itdwtzjmxk4o41
jelmer at samba.org-20070221105255-dfi4vebkw1x35m8j
jelmer at samba.org-20070221113036-clajwiyqor6weyhh
jelmer at samba.org-20070221114205-6e61yds88np0hzuw
jelmer at samba.org-20070221114904-3wvjhp50c49ad6gj
jelmer at samba.org-20070221123127-0131p4yw87krxoif
jelmer at samba.org-20070221141543-vl5ror4myglk0fer
jelmer at samba.org-20070221205428-1zdem89mxo23fywq
jelmer at samba.org-20070225093009-0ymfldx8sq4dyqlx
jelmer at samba.org-20070225095105-xz76nand5qx31kzq
jelmer at samba.org-20070226010036-ra2i9iwwxgyhf436
jelmer at samba.org-20070226161456-f3ao5hpde0qf6jbr
jelmer at samba.org-20070226165025-2qr2oc1rk9o1u9ba
jelmer at samba.org-20070226174019-kgi3y7tzvwo4j05f
jelmer at samba.org-20070227124322-3lgrgarnqqzbyjbn
jelmer at samba.org-20070227133930-3isrqux11mtqpxkg
jelmer at samba.org-20070227175650-o69jjz1zyqe4zkuu
jelmer at samba.org-20070227203216-ewscmau41yygf7vn
jelmer at samba.org-20070227213357-po1j24g7hxzb0zub
jelmer at samba.org-20070227234431-sph4np74aq8dywrh
jelmer at samba.org-20070228001632-63x0t6c7cyowj18c
jelmer at samba.org-20070228002439-a604a1yg8myq8qlr
jelmer at samba.org-20070228003232-gx98ohwohqa3y0hp
jelmer at samba.org-20070228014756-k9hoae1822hg8fke
jelmer at samba.org-20070228015909-td0bfe324fsicupz
jelmer at samba.org-20070228020348-xip9pfy6ou5otvu9
jelmer at samba.org-20070228104928-qblk4we17a6wyqds
jelmer at samba.org-20070228132131-0pcf9e2ie5xo4hak
jelmer at samba.org-20070228145334-ly9jormrctz49jn4
jelmer at samba.org-20070302124451-iifyah7w73bjwimu
jelmer at samba.org-20070302134225-iu9mwzaaoa6w6v7u
jelmer at samba.org-20070302140325-8r0y5c9gxvhh14h0
jelmer at samba.org-20070302145020-vqd2uje8lieprfy6
jelmer at samba.org-20070302161759-q1mr3ki1s7oneyrh
jelmer at samba.org-20070302175850-jhtkiyk1a3urttvu
jelmer at samba.org-20070302182508-udkpisu7g3orp0k7
jelmer at samba.org-20070302191137-78hcw42xtxf0zf4j
jelmer at samba.org-20070303002438-925hy1uxyetacn9s
jelmer at samba.org-20070303005426-y4mtafvvqvm8qlqi
jelmer at samba.org-20070303011649-elz7bumnf6tbb2t7
jelmer at samba.org-20070303020345-gesw3rzz8mfrmmis
jelmer at samba.org-20070303145732-2uga567lndju11gw
jelmer at samba.org-20070303150956-m50rt9737da97btr
jelmer at samba.org-20070303152516-ckgm8952fpbbr53o
jelmer at samba.org-20070303153221-651522rqfmo3x6gn
jelmer at samba.org-20070303155018-hmltewkermcrzouj
jelmer at samba.org-20070303161939-nmu63j6e89r5fv1k
jelmer at samba.org-20070303183822-i2va1urjadag47vs
jelmer at samba.org-20070304141159-fcbzizinrrtr52ow
jelmer at samba.org-20070304142825-nt6vfy3qfo2k9mod
jelmer at samba.org-20070304181820-twspnnd2cv1so1vv
jelmer at samba.org-20070304183236-cyc4mo7rt5acou2g
jelmer at samba.org-20070304194926-hyaq600mg5v36oez

   + jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
jelmer at samba.org-20061017145110-8c83a3dd979f6a6a
jelmer at samba.org-20061029173623-eb0459f1d3eb5720
jelmer at samba.org-20070115022006-h5ef1deqflt940b6
jelmer at samba.org-20070116142934-hv99dpwbnq2znh8f
jelmer at samba.org-20070116144126-70rip3bppmvgs3t6
jelmer at samba.org-20070116151516-imvui4r33cj850j9
jelmer at samba.org-20070116154739-3tji4fft7964qgrj
jelmer at samba.org-20070116173900-iasa25stcfty6pbr
jelmer at samba.org-20070117144550-te3o0iy10y14iyo4
jelmer at samba.org-20070122000024-q911packyrjk69ud
jelmer at samba.org-20070122181120-3n8ah238pjbzylyo
jelmer at samba.org-20070122182054-6b26fqrdqyjhyeuc
jelmer at samba.org-20070122233549-k085tfo2o1eqz7mm
jelmer at samba.org-20070123002251-0smz35eva10x84tc
jelmer at samba.org-20070123003546-p0jl6j9tw79q5j1k
jelmer at samba.org-20070123012404-o9w5pmgkm94zsxlu
jelmer at samba.org-20070123094731-ns7dzzzqtb0dlcod
jelmer at samba.org-20070125123431-g3pqm92r31ez9xyc
jelmer at samba.org-20070126125959-3w3t26aps9hmwukv
jelmer at samba.org-20070126132607-64kt7rc2wtqh0c7u
jelmer at samba.org-20070126133903-onfotbg1051ktojo
jelmer at samba.org-20070126144259-171b4t0744jigs5x
jelmer at samba.org-20070126152205-xj7j1avc7683rjy5
jelmer at samba.org-20070128010235-e8st47gcy00ii8kc
jelmer at samba.org-20070128130853-xjjrlrtf830pwnx6
jelmer at samba.org-20070130120806-gfqshokma9j6j3uv
jelmer at samba.org-20070131002510-55yxynmb1o4zvx0x
jelmer at samba.org-20070131115042-oocen3olfgu53jlm
jelmer at samba.org-20070206235608-980jutwyp43708k6
jelmer at samba.org-20070207185718-i1xx6bvmdeeii72p
jelmer at samba.org-20070208234639-i0h5mfefbn1a1lkl
jelmer at samba.org-20070209001154-lol5huzwdq9jw2e7
jelmer at samba.org-20070209093351-buzkh0t55nt863gw
jelmer at samba.org-20070212120516-lwfxtpxx1lerwro2
jelmer at samba.org-20070212130037-e7t2bh0ufajvi8m6
jelmer at samba.org-20070212173050-hpr37tn9ws2zhfko
jelmer at samba.org-20070214123932-nmsy6lnin8gtzxrn
jelmer at samba.org-20070214141810-0df8ykq1d0dl6yia
jelmer at samba.org-20070214143534-pc63vqrp827s6sdo
jelmer at samba.org-20070214145213-idzserezbwc2alty
jelmer at samba.org-20070214150805-zjdhqbtwy28fac3c
jelmer at samba.org-20070214192135-0yxxt5pto2lv4p4h
jelmer at samba.org-20070214213108-id4l0x9g95v6i060
jelmer at samba.org-20070215192824-a13ptx6qq150shoq
jelmer at samba.org-20070215210330-ve8q1mdkjymv6fr1
jelmer at samba.org-20070215220450-avh0rwc0ce0x7gja
jelmer at samba.org-20070215225539-cy8w0815ygz1wa0c
jelmer at samba.org-20070215234924-5u8bqtdp3ha66015
jelmer at samba.org-20070216003036-0ghop153wj46jjwe
jelmer at samba.org-20070216010504-03udexhmrhje5w5c
jelmer at samba.org-20070216124407-uwk21820sjr6n46p
jelmer at samba.org-20070216141029-nf84hlj2tr39ealw
jelmer at samba.org-20070216151123-m8lw5r1ebhymw8ba
jelmer at samba.org-20070217013108-znc8d1w6rtx0kaqf
jelmer at samba.org-20070217135603-92hi5qaxrxwoqulu
jelmer at samba.org-20070217233534-x58078kx0zci6831
jelmer at samba.org-20070218003055-80z3rswwe279yelu
jelmer at samba.org-20070218003815-07xijfqrcx3tybfi
jelmer at samba.org-20070218010222-fe4oase328jeg840
jelmer at samba.org-20070218115359-jytly04u0aufe8vn
jelmer at samba.org-20070218115806-9h8thqvb95iffgh5
jelmer at samba.org-20070218120236-9q5wvlctgevr438d
jelmer at samba.org-20070218120857-cg7f6ppc1b3jd2nj
jelmer at samba.org-20070218122007-5c147i8tk17nh31s
jelmer at samba.org-20070218125126-mq0gsnn6mdt0dr5p
jelmer at samba.org-20070218133855-zz8l3b16rc7rh5n9
jelmer at samba.org-20070218134908-r7jzuwppx6odzgao
jelmer at samba.org-20070218161231-qs4bbg2mkz3lo6rf
jelmer at samba.org-20070218164355-wcsqzlh7s37se8xk
jelmer at samba.org-20070218165112-edgr3gi0gg7aaqlj
jelmer at samba.org-20070218183655-2qk7xgjc222tls7y
jelmer at samba.org-20070218234351-nxjnkhl4bc4x00df
jelmer at samba.org-20070218235514-ziine4dmb38u0xv3
jelmer at samba.org-20070219004515-smmtdyy6deud4adv
jelmer at samba.org-20070219014759-jv5otc3ij03d89va
jelmer at samba.org-20070219192807-w8shsv06u698i3du
jelmer at samba.org-20070219212917-syg7v8ejwpfa8grh
jelmer at samba.org-20070219220607-f2xy405hjsim9l4p
jelmer at samba.org-20070219230825-to4yp0eswh2gd283
jelmer at samba.org-20070220012443-ky7aj0q1ra0t1ivl
jelmer at samba.org-20070220224521-cwtsy3lkbyppctj6
jelmer at samba.org-20070220231211-pizf7rowfbhdws2n
jelmer at samba.org-20070221102807-1eot92jt41ax1dg5
jelmer at samba.org-20070221103458-93itdwtzjmxk4o41
jelmer at samba.org-20070221105255-dfi4vebkw1x35m8j
jelmer at samba.org-20070221113036-clajwiyqor6weyhh
jelmer at samba.org-20070221114205-6e61yds88np0hzuw
jelmer at samba.org-20070221114904-3wvjhp50c49ad6gj
jelmer at samba.org-20070221123127-0131p4yw87krxoif
jelmer at samba.org-20070221141543-vl5ror4myglk0fer
jelmer at samba.org-20070221205428-1zdem89mxo23fywq
jelmer at samba.org-20070225093009-0ymfldx8sq4dyqlx
jelmer at samba.org-20070225095105-xz76nand5qx31kzq
jelmer at samba.org-20070226010036-ra2i9iwwxgyhf436
jelmer at samba.org-20070226161456-f3ao5hpde0qf6jbr
jelmer at samba.org-20070226165025-2qr2oc1rk9o1u9ba
jelmer at samba.org-20070226174019-kgi3y7tzvwo4j05f
jelmer at samba.org-20070227124322-3lgrgarnqqzbyjbn
jelmer at samba.org-20070227133930-3isrqux11mtqpxkg
jelmer at samba.org-20070227175650-o69jjz1zyqe4zkuu
jelmer at samba.org-20070227203216-ewscmau41yygf7vn
jelmer at samba.org-20070227213357-po1j24g7hxzb0zub
jelmer at samba.org-20070227234431-sph4np74aq8dywrh
jelmer at samba.org-20070228001632-63x0t6c7cyowj18c
jelmer at samba.org-20070228002439-a604a1yg8myq8qlr
jelmer at samba.org-20070228003232-gx98ohwohqa3y0hp
jelmer at samba.org-20070228014756-k9hoae1822hg8fke
jelmer at samba.org-20070228015909-td0bfe324fsicupz
jelmer at samba.org-20070228020348-xip9pfy6ou5otvu9
jelmer at samba.org-20070228104928-qblk4we17a6wyqds
jelmer at samba.org-20070228132131-0pcf9e2ie5xo4hak
jelmer at samba.org-20070228145334-ly9jormrctz49jn4
jelmer at samba.org-20070302124451-iifyah7w73bjwimu
jelmer at samba.org-20070302134225-iu9mwzaaoa6w6v7u
jelmer at samba.org-20070302140325-8r0y5c9gxvhh14h0
jelmer at samba.org-20070302145020-vqd2uje8lieprfy6
jelmer at samba.org-20070302161759-q1mr3ki1s7oneyrh
jelmer at samba.org-20070302175850-jhtkiyk1a3urttvu
jelmer at samba.org-20070302182508-udkpisu7g3orp0k7
jelmer at samba.org-20070302191137-78hcw42xtxf0zf4j
jelmer at samba.org-20070303002438-925hy1uxyetacn9s
jelmer at samba.org-20070303005426-y4mtafvvqvm8qlqi
jelmer at samba.org-20070303011649-elz7bumnf6tbb2t7
jelmer at samba.org-20070303020345-gesw3rzz8mfrmmis
jelmer at samba.org-20070303145732-2uga567lndju11gw
jelmer at samba.org-20070303150956-m50rt9737da97btr
jelmer at samba.org-20070303152516-ckgm8952fpbbr53o
jelmer at samba.org-20070303153221-651522rqfmo3x6gn
jelmer at samba.org-20070303155018-hmltewkermcrzouj
jelmer at samba.org-20070303161939-nmu63j6e89r5fv1k
jelmer at samba.org-20070303183822-i2va1urjadag47vs
jelmer at samba.org-20070304141159-fcbzizinrrtr52ow
jelmer at samba.org-20070304142825-nt6vfy3qfo2k9mod
jelmer at samba.org-20070304181820-twspnnd2cv1so1vv
jelmer at samba.org-20070304183236-cyc4mo7rt5acou2g
jelmer at samba.org-20070304194926-hyaq600mg5v36oez
jelmer at samba.org-20070304223307-xafpwvov6tgmdb8z


Added: branches/SAMBA_4_0/source/lib/compression/testsuite.c
===================================================================
--- branches/SAMBA_4_0/source/lib/compression/testsuite.c	2007-03-04 21:16:57 UTC (rev 21687)
+++ branches/SAMBA_4_0/source/lib/compression/testsuite.c	2007-03-04 22:36:41 UTC (rev 21688)
@@ -0,0 +1,33 @@
+/* 
+   Unix SMB/CIFS implementation.
+   test suite for the compression functions
+
+   Copyright (C) Jelmer Vernooij 2007
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+#include "torture/torture.h"
+#include "lib/compression/mszip.h"
+
+struct torture_suite *torture_local_compression(TALLOC_CTX *mem_ctx)
+{
+	struct torture_suite *suite = torture_suite_create(mem_ctx, "COMPRESSION");
+
+	torture_suite_add_simple_test(suite, "pull_charset", test_pull_charset);
+
+	return suite;
+}

Added: branches/SAMBA_4_0/source/lib/util/tests/genrand.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util/tests/genrand.c	2007-03-04 21:16:57 UTC (rev 21687)
+++ branches/SAMBA_4_0/source/lib/util/tests/genrand.c	2007-03-04 22:36:41 UTC (rev 21688)
@@ -0,0 +1,66 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   local testing of random data routines.
+
+   Copyright (C) Jelmer Vernooij <jelmer at samba.org>
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+#include "torture/torture.h"
+
+static void dummy_reseed(int *d)
+{
+	*d = 42;
+}
+
+static bool test_reseed_callback(struct torture_context *tctx)
+{
+	set_rand_reseed_callback(dummy_reseed);
+	return true;
+}
+
+static bool test_check_password_quality(struct torture_context *tctx)
+{
+	torture_assert(tctx, !check_password_quality(""), "empty password");
+	torture_assert(tctx, !check_password_quality("a"), "one char password");
+	torture_assert(tctx, !check_password_quality("aaaaaaaaaaaa"), "same char password");
+	torture_assert(tctx, !check_password_quality("BLA"), "multiple upcases password");
+	torture_assert(tctx, !check_password_quality("123"), "digits only");
+	torture_assert(tctx, check_password_quality("A2e"), "valid");
+	torture_assert(tctx, check_password_quality("BA2eLi443"), "valid");
+	return true;
+}
+
+static bool test_generate_random_str(struct torture_context *tctx)
+{
+	TALLOC_CTX *mem_ctx = talloc_init(__FUNCTION__);
+	char *r = generate_random_str(mem_ctx, 10);
+	torture_assert_int_equal(tctx, strlen(r), 10, "right length generated");
+	r = generate_random_str(mem_ctx, 5);
+	torture_assert_int_equal(tctx, strlen(r), 5, "right length generated");
+	return true;
+}
+
+struct torture_suite *torture_local_genrand(TALLOC_CTX *mem_ctx)
+{
+	struct torture_suite *suite = torture_suite_create(mem_ctx, "GENRAND");
+	torture_suite_add_simple_test(suite, "reseed_callback", test_reseed_callback);
+	torture_suite_add_simple_test(suite, "check_password_quality", test_check_password_quality);
+	torture_suite_add_simple_test(suite, "generate_random_str", test_generate_random_str);
+	return suite;
+}

Modified: branches/SAMBA_4_0/source/torture/local/config.mk
===================================================================
--- branches/SAMBA_4_0/source/torture/local/config.mk	2007-03-04 21:16:57 UTC (rev 21687)
+++ branches/SAMBA_4_0/source/torture/local/config.mk	2007-03-04 22:36:41 UTC (rev 21688)
@@ -25,6 +25,7 @@
 		resolve.o \
 		../../lib/util/tests/strlist.o \
 		../../lib/util/tests/file.o \
+		../../lib/util/tests/genrand.o \
 		sddl.o \
 		../../lib/tdr/testsuite.o \
 		event.o \

Modified: branches/SAMBA_4_0/source/torture/local/local.c
===================================================================
--- branches/SAMBA_4_0/source/torture/local/local.c	2007-03-04 21:16:57 UTC (rev 21687)
+++ branches/SAMBA_4_0/source/torture/local/local.c	2007-03-04 22:36:41 UTC (rev 21688)
@@ -35,6 +35,7 @@
 	torture_local_util_strlist, 
 	torture_local_util_file, 
 	torture_local_idtree, 
+	torture_local_genrand, 
 	torture_local_iconv,
 	torture_local_socket, 
 	torture_local_socket_wrapper, 



More information about the samba-cvs mailing list