test_funcs.c File Reference
#include "common.h"
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include "bio.h"
#include "../bu_internals.h"
#include "./test_internals.h"
Include dependency graph for test_funcs.c:

Go to the source code of this file.


long int bu_get_urandom_number ()
void dump_bitv (const struct bu_bitv *b)
void random_hex_or_binary_string (struct bu_vls *v, const hex_bin_enum_t typ, const int nbytes)

Detailed Description

Miscellaneous functions for libbu tests.

Definition in file test_funcs.c.

Function Documentation

long int bu_get_urandom_number ( )

Get a random number from system entropy (typically used for seeding the 'random' function).

Definition at line 43 of file test_funcs.c.

References bu_exit(), and bu_log().

Referenced by random_hex_or_binary_string().

Here is the call graph for this function:

void dump_bitv ( const struct bu_bitv )

Dump a bitv into a detailed bit format for debugging.

Definition at line 60 of file test_funcs.c.

References bu_bitv::bits, BITS_PER_BYTE, bu_log(), bu_vls_cstr(), bu_vls_free(), bu_vls_printf(), bu_vls_vlsinit(), bu_bitv::nbits, and OSL::Strings::v.

Here is the call graph for this function:

void random_hex_or_binary_string ( struct bu_vls v,
const hex_bin_enum_t  typ,
const int  nbytes 

Get a random string of hex or binary characters (possibly with a leading '0x' or '0b').

Definition at line 151 of file test_funcs.c.

References BINARY, BITS_PER_BYTE, bu_get_urandom_number(), bu_vls_extend(), bu_vls_prepend(), bu_vls_putc(), bu_vls_trunc(), HEX, and HEXCHARS_PER_BYTE.

Here is the call graph for this function: