random_test.c File Reference

#include <config.h>
#include <isc/random.h>
#include <isc/result.h>
#include <isc/mem.h>
#include <isc/util.h>
#include <atf-c.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>

Go to the source code of this file.

Typedefs

typedef double( pvalue_func_t )(isc_mem_t *mctx, isc_uint16_t *values, size_t length)

Functions

static double igamc (double a, double x)
static double igam (double a, double x)
static isc_int8_t scount_calculate (isc_uint16_t n)
static isc_uint8_t bitcount_calculate (isc_uint16_t n)
static void tables_init (void)
static isc_uint32_t matrix_binaryrank (isc_uint32_t *bits, ssize_t rows, ssize_t cols)
static void random_test (pvalue_func_t *func)
static double monobit (isc_mem_t *mctx, isc_uint16_t *values, size_t length)
static double runs (isc_mem_t *mctx, isc_uint16_t *values, size_t length)
static double blockfrequency (isc_mem_t *mctx, isc_uint16_t *values, size_t length)
static double binarymatrixrank (isc_mem_t *mctx, isc_uint16_t *values, size_t length)
 ATF_TC (isc_rng_monobit)
 ATF_TC_HEAD (isc_rng_monobit, tc)
 ATF_TC_BODY (isc_rng_monobit, tc)
 ATF_TC (isc_rng_runs)
 ATF_TC_HEAD (isc_rng_runs, tc)
 ATF_TC_BODY (isc_rng_runs, tc)
 ATF_TC (isc_rng_blockfrequency)
 ATF_TC_HEAD (isc_rng_blockfrequency, tc)
 ATF_TC_BODY (isc_rng_blockfrequency, tc)
 ATF_TC (isc_rng_binarymatrixrank)
 ATF_TC_HEAD (isc_rng_binarymatrixrank, tc)
 ATF_TC_BODY (isc_rng_binarymatrixrank, tc)
 ATF_TP_ADD_TCS (tp)

Variables

static double MACHEP = 1.11022302462515654042E-16
static double MAXLOG = 7.09782712893383996843E2
static double big = 4.503599627370496e15
static double biginv = 2.22044604925031308085e-16
static isc_int8_t scounts_table [65536]
static isc_uint8_t bitcounts_table [65536]


Typedef Documentation

typedef double( pvalue_func_t)(isc_mem_t *mctx, isc_uint16_t *values, size_t length)

Definition at line 30 of file random_test.c.


Function Documentation

static double igamc ( double  a,
double  x 
) [static]

Definition at line 52 of file random_test.c.

References big, biginv, igam(), MACHEP, MAXLOG, and r.

Referenced by blockfrequency(), igam(), and random_test().

static double igam ( double  a,
double  x 
) [static]

Definition at line 110 of file random_test.c.

References igamc(), MACHEP, MAXLOG, and r.

Referenced by igamc().

static isc_int8_t scount_calculate ( isc_uint16_t  n  )  [static]

Definition at line 145 of file random_test.c.

Referenced by tables_init().

static isc_uint8_t bitcount_calculate ( isc_uint16_t  n  )  [static]

Definition at line 166 of file random_test.c.

Referenced by tables_init().

static void tables_init ( void   )  [static]

Definition at line 185 of file random_test.c.

References bitcount_calculate(), bitcounts_table, scount_calculate(), and scounts_table.

Referenced by random_test().

static isc_uint32_t matrix_binaryrank ( isc_uint32_t bits,
ssize_t  rows,
ssize_t  cols 
) [static]

Definition at line 202 of file random_test.c.

Referenced by binarymatrixrank().

static void random_test ( pvalue_func_t func  )  [static]

Definition at line 248 of file random_test.c.

References igamc(), isc_mem_create(), ISC_R_SUCCESS, isc_rng_create(), isc_rng_detach(), isc_rng_random(), mctx, and tables_init().

Referenced by ATF_TC_BODY().

static double monobit ( isc_mem_t mctx,
isc_uint16_t values,
size_t  length 
) [static]

Definition at line 353 of file random_test.c.

References scounts_table, and UNUSED.

Referenced by ATF_TC_BODY().

static double runs ( isc_mem_t mctx,
isc_uint16_t values,
size_t  length 
) [static]

Definition at line 384 of file random_test.c.

References bcount, bitcounts_table, tau, and UNUSED.

Referenced by ATF_TC_BODY().

static double blockfrequency ( isc_mem_t mctx,
isc_uint16_t values,
size_t  length 
) [static]

Definition at line 460 of file random_test.c.

References bitcounts_table, igamc(), isc_mem_get, and isc_mem_put.

Referenced by ATF_TC_BODY().

static double binarymatrixrank ( isc_mem_t mctx,
isc_uint16_t values,
size_t  length 
) [static]

Definition at line 525 of file random_test.c.

References matrix_binaryrank(), r1, r2, and UNUSED.

Referenced by ATF_TC_BODY().

ATF_TC ( isc_rng_monobit   ) 

ATF_TC_HEAD ( isc_rng_monobit  ,
tc   
)

Definition at line 607 of file random_test.c.

ATF_TC_BODY ( isc_rng_monobit  ,
tc   
)

Definition at line 611 of file random_test.c.

References monobit(), random_test(), and UNUSED.

ATF_TC ( isc_rng_runs   ) 

ATF_TC_HEAD ( isc_rng_runs  ,
tc   
)

Definition at line 618 of file random_test.c.

ATF_TC_BODY ( isc_rng_runs  ,
tc   
)

Definition at line 622 of file random_test.c.

References random_test(), runs(), and UNUSED.

ATF_TC ( isc_rng_blockfrequency   ) 

ATF_TC_HEAD ( isc_rng_blockfrequency  ,
tc   
)

Definition at line 629 of file random_test.c.

ATF_TC_BODY ( isc_rng_blockfrequency  ,
tc   
)

Definition at line 633 of file random_test.c.

References blockfrequency(), random_test(), and UNUSED.

ATF_TC ( isc_rng_binarymatrixrank   ) 

ATF_TC_HEAD ( isc_rng_binarymatrixrank  ,
tc   
)

Definition at line 640 of file random_test.c.

ATF_TC_BODY ( isc_rng_binarymatrixrank  ,
tc   
)

Definition at line 648 of file random_test.c.

References binarymatrixrank(), random_test(), and UNUSED.

ATF_TP_ADD_TCS ( tp   ) 

Definition at line 657 of file random_test.c.


Variable Documentation

double MACHEP = 1.11022302462515654042E-16 [static]

Definition at line 43 of file random_test.c.

Referenced by igam(), and igamc().

double MAXLOG = 7.09782712893383996843E2 [static]

Definition at line 44 of file random_test.c.

Referenced by igam(), and igamc().

double big = 4.503599627370496e15 [static]

Definition at line 45 of file random_test.c.

Referenced by igamc().

double biginv = 2.22044604925031308085e-16 [static]

Definition at line 46 of file random_test.c.

Referenced by igamc().

isc_int8_t scounts_table[65536] [static]

Definition at line 141 of file random_test.c.

Referenced by monobit(), and tables_init().

isc_uint8_t bitcounts_table[65536] [static]

Definition at line 142 of file random_test.c.

Referenced by blockfrequency(), runs(), and tables_init().


Generated on Tue Apr 28 17:41:18 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha