GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > ZFS / V0-0-1

Constituent: zlib_unit_test     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

zlib_unit_test.c File Reference

ZLIB package unit test program. More...

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "unistd.h"
#include "fcntl.h"
#include "sys/types.h"
#include "sys/stat.h"
#include "ZLIB/zlib.h"
#include "ZFS/ZLIB_msg.h"
#include "ZFS/ZLIB_file_inflate.h"
#include "ZFS/ZLIB_file_compress.h"
#include "ZFS/zlib_unit_test.h"
#include "PBS/PBS.h"
#include "PBS/BSWP.h"
#include "PBS/MBA.h"
#include "PBS/TASK.h"
#include "MSG/MSG_pubdefs.h"
#include "MSG/MSG_printProc.h"

Include dependency graph for zlib_unit_test.c:


Defines

#define ZLIB_ARG_VALUE   0x12345678

Functions

int PBS_shutdown (void)
static int zlib_inflate_test_param (void)
static int zlib_inflate_test_func (void)
static int zlib_inflate_test_data_err (void)
static int zlib_compress_test_param (void)
static int zlib_compress_test_func (void)
static int zlib_file_inflate_test_param (void)
static int zlib_file_compress_test_param (void)
static void * zlib_alloc (void *arg, unsigned int items, unsigned int size)
static void zlib_free (void *arg, void *address)
static void zlib_print (z_streamp s, const char *msg)
int zlib_unit_test (void)
int main (int argc, char **argv)

Variables

unsigned char zlib_orig_buf_0 []
unsigned char zlib_comp_buf_0 []
unsigned char zlib_err_buf_0 []
unsigned int zlib_orig_buf_0_size
unsigned int zlib_comp_buf_0_size
unsigned int zlib_err_buf_0_size
unsigned char zlib_orig_buf_1 []
unsigned char zlib_comp_buf_1 []
unsigned char zlib_err_buf_1 []
unsigned int zlib_orig_buf_1_size
unsigned int zlib_comp_buf_1_size
unsigned int zlib_err_buf_1_size
static const char * sepStr = "-----------------------------------------------------------\n"

Detailed Description

ZLIB package unit test program.

Author:
D.L. Wood
Tests the following constituents:


Define Documentation

#define ZLIB_ARG_VALUE   0x12345678
 

A dummy value passed to the memory allocation callbacks. Used to check that callback arg passing is working correctly.


Function Documentation

int main int  argc,
char **  argv
 

The UNIX application entry point.

Parameters:
argc The number of command line args.
argv The list of command line args.
Return values:
0 Success.
-1 Failure.

int PBS_shutdown void   ) 
 

PBS global shutdown function.

static void * zlib_alloc void *  arg,
unsigned int  items,
unsigned int  size
[static]
 

ZLIB memory allocation function used for the unit tests.

Parameters:
arg A user defined argument.
items The number of items to allocate.
size The size of each item to allocate.
Returns:
A pointer to the allocated memory, or NULL on error.

static int zlib_compress_test_func void   )  [static]
 

Tests the basic functionality of the deflate() interface by compressing some sample data sets.

Return values:
0 Success.
-1 Failure.

static int zlib_compress_test_param void   )  [static]
 

Performs invalid and out of range tests on parameters for zlib_compress library functions.

Return values:
0 Success.
-1 Failure

static int zlib_file_compress_test_param void   )  [static]
 

Performs invalid and out of range tests on parameters for zlib_file_compress library functions.

Return values:
0 Success.
-1 Failure

static int zlib_file_inflate_test_param void   )  [static]
 

Performs invalid and out of range tests on parameters for zlib_file_inflate library functions.

Return values:
0 Success.
-1 Failure

static void zlib_free void *  arg,
void *  address
[static]
 

ZLIB memory release function used for the unit tests.

Parameters:
arg A user defined argument.
address The address of the memory to free.

static int zlib_inflate_test_data_err void   )  [static]
 

Tests the inflate() to make sure it signals an error on a corrupted compressed data set.

Return values:
0 Success.
-1 Failure.

static int zlib_inflate_test_func void   )  [static]
 

Tests the basic functionality of the inflate() interface by inflating some sample data sets.

Return values:
0 Success.
-1 Failure.

static int zlib_inflate_test_param void   )  [static]
 

Performs invalid and out of range tests on parameters for zlib_inflate library functions.

Return values:
0 Success.
-1 Failure

static void zlib_print z_streamp  s,
const char *  msg
[static]
 

Displays the state of the ZLIB stream.

Parameters:
s A pointer to the ZLIB stream descriptor.
msg A message to display at top of printout.

iint zlib_unit_test void   ) 
 

Performs all of the unit tests associated with the ZLIB package. Tests the following constituents:

  • zlib_inflate
  • zlib_compress

Return values:
0 Success.
-1 Failure


Variable Documentation

sepStr = "-----------------------------------------------------------\n" [static]
 

A line separator string.

zlib_comp_buf_0
 

The correct compressed format of zlib_orig_buf_0.

zlib_comp_buf_0_size
 

The size in bytes of zlib_comp_buf_0.

zlib_comp_buf_1
 

The correct compressed format of zlib_orig_buf_1.

zlib_comp_buf_1_size
 

The size in bytes of zlib_comp_buf_1.

zlib_err_buf_0
 

The compressed format of zlib_orig_buf_0 with a single bit error.

zlib_err_buf_0_size
 

The size in bytes of zlib_err_buf_0.

zlib_err_buf_1
 

The compressed format of zlib_orig_buf_1 with a single bit error.

zlib_err_buf_1_size
 

The size in bytes of zlib_err_buf_1.

zlib_orig_buf_0
 

A sample of an original data file to be compressed.

zlib_orig_buf_0_size
 

The size in bytes of zlib_orig_buf_0.

zlib_orig_buf_1
 

A sample of an original data file to be compressed.

zlib_orig_buf_1_size
 

The size in bytes of zlib_orig_buf_1.


Generated on Fri Jan 6 21:12:27 2006 by  doxygen 1.4.4