testbits.cxx File Reference

#include "TROOT.h"
#include "TBits.h"
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define A(exp)
#define DO_TEST(exp)

Functions

static void test_set_bit ()
static void set_bits_by_char (TBits &bits, UInt_t nbits)
static void assert_bits_by_char (const TBits &bits, UInt_t nbits)
static void set_bits_by_short (TBits &bits, UInt_t nbits)
static void assert_bits_by_short (const TBits &bits, UInt_t nbits)
static void set_bits_by_int (TBits &bits, UInt_t nbits)
static void assert_bits_by_int (const TBits &bits, UInt_t nbits)
static void set_bits (TBits &bits, UInt_t nbits)
static void assert_bits (const TBits &bits, UInt_t nbits)
static void test_set_from_char (UInt_t nbits)
static void test_set_from_short (UInt_t nbits)
static void test_set_from_int (UInt_t nbits)
static void test_get_to_char (UInt_t nbits)
static void test_get_to_short (UInt_t nbits)
static void test_get_to_int (UInt_t nbits)
int main (int, char **v)

Variables

static const char * current_test
static unsigned test_count
static const Char_t char_bits []
static const Short_t short_bits []
static const Int_t int_bits []


Define Documentation

#define A ( exp   ) 

Value:

do {\
    if (!(exp)) {\
        fprintf(stderr," FAILURE!\n\nIn %s:\n\n",current_test);\
        fprintf(stderr,"Assertion (%s) failed at %s:%d.\n\n",\
                       #exp,__FILE__,__LINE__);\
        exit(1);\
    }\
} while (0)

Definition at line 15 of file testbits.cxx.

#define DO_TEST ( exp   ) 

Value:

do {\
    current_test=#exp;\
    fprintf(stderr,".");\
    fflush(stderr);\
    exp;\
    ++test_count;\
} while (0)

Definition at line 24 of file testbits.cxx.

Referenced by main().


Function Documentation

static void assert_bits ( const TBits bits,
UInt_t  nbits 
) [static]

Definition at line 125 of file testbits.cxx.

References A, bits, i, and j.

Referenced by test_set_from_char(), test_set_from_int(), and test_set_from_short().

static void assert_bits_by_char ( const TBits bits,
UInt_t  nbits 
) [static]

Definition at line 66 of file testbits.cxx.

References A, bits, buf, char_bits, and i.

Referenced by test_get_to_char().

static void assert_bits_by_int ( const TBits bits,
UInt_t  nbits 
) [static]

Definition at line 96 of file testbits.cxx.

References A, bits, buf, i, and int_bits.

Referenced by test_get_to_int().

static void assert_bits_by_short ( const TBits bits,
UInt_t  nbits 
) [static]

Definition at line 81 of file testbits.cxx.

References A, bits, buf, i, and short_bits.

Referenced by test_get_to_short().

int main ( int  ,
char **  v 
)

Definition at line 183 of file testbits.cxx.

References DO_TEST, fprintf(), test_count, test_get_to_char(), test_get_to_int(), test_get_to_short(), test_set_bit(), test_set_from_char(), test_set_from_int(), and test_set_from_short().

static void set_bits ( TBits bits,
UInt_t  nbits 
) [static]

Definition at line 106 of file testbits.cxx.

References bits, i, and j.

Referenced by test_get_to_char(), test_get_to_int(), and test_get_to_short().

static void set_bits_by_char ( TBits bits,
UInt_t  nbits 
) [static]

Definition at line 61 of file testbits.cxx.

References bits, and char_bits.

Referenced by test_set_from_char().

static void set_bits_by_int ( TBits bits,
UInt_t  nbits 
) [static]

Definition at line 91 of file testbits.cxx.

References bits, and int_bits.

Referenced by test_set_from_int().

static void set_bits_by_short ( TBits bits,
UInt_t  nbits 
) [static]

Definition at line 76 of file testbits.cxx.

References bits, and short_bits.

Referenced by test_set_from_short().

static void test_get_to_char ( UInt_t  nbits  )  [static]

Definition at line 162 of file testbits.cxx.

References assert_bits_by_char(), b, and set_bits().

Referenced by main().

static void test_get_to_int ( UInt_t  nbits  )  [static]

Definition at line 174 of file testbits.cxx.

References assert_bits_by_int(), b, and set_bits().

Referenced by main().

static void test_get_to_short ( UInt_t  nbits  )  [static]

Definition at line 168 of file testbits.cxx.

References assert_bits_by_short(), b, and set_bits().

Referenced by main().

static void test_set_bit (  )  [static]

Definition at line 32 of file testbits.cxx.

References A, and b.

Referenced by main().

static void test_set_from_char ( UInt_t  nbits  )  [static]

Definition at line 144 of file testbits.cxx.

References assert_bits(), b, and set_bits_by_char().

Referenced by main().

static void test_set_from_int ( UInt_t  nbits  )  [static]

Definition at line 156 of file testbits.cxx.

References assert_bits(), b, and set_bits_by_int().

Referenced by main().

static void test_set_from_short ( UInt_t  nbits  )  [static]

Definition at line 150 of file testbits.cxx.

References assert_bits(), b, and set_bits_by_short().

Referenced by main().


Variable Documentation

const Char_t char_bits[] [static]

Initial value:

 {
    0,
    1,
    3,
    7,
    15,
    31,
    63,
    127
}

Definition at line 38 of file testbits.cxx.

Referenced by assert_bits_by_char(), and set_bits_by_char().

const char* current_test [static]

Definition at line 12 of file testbits.cxx.

const Int_t int_bits[] [static]

Initial value:

 {
    0 + 1 * 256 + 3 * 65536 + 7 * 16777216,
    15 + 31 * 256 + 63 * 65536 + 127 * 16777216
}

Definition at line 56 of file testbits.cxx.

Referenced by assert_bits_by_int(), and set_bits_by_int().

const Short_t short_bits[] [static]

Initial value:

 {
    0 + 1 * 256,
    3 + 7 * 256,
    15 + 31 * 256,
    63 + 127 * 256
}

Definition at line 49 of file testbits.cxx.

Referenced by assert_bits_by_short(), and set_bits_by_short().

unsigned test_count [static]

Definition at line 13 of file testbits.cxx.

Referenced by main().


Generated on Tue Jul 5 16:08:55 2011 for ROOT_528-00b_version by  doxygen 1.5.1