NAME

CTest - Perl extension for testing local 'C' routines

SYNOPSIS

use CTest;

DESCRIPTION

This module consists of various test routines to exercise the subroutines in the the 'C' pieces for bdbaccess

  • $rv=t_main(qw(program_name args, arg2,..., argN);

      input:	program name
    		-d
    		-f etc... see readme
      output:	number of arguments passed
  • t_setport(pnum);

    set the port value to pnum
    
    input:	integer port number
    output:	none
  • t_setsig();

    set the signal handler. 
    test routine should issue SIGINT 
    to child and catch resulting text
  • t_set_parent(val);

    set the value of "parent"
    return the previous value
  • $pid = t_pidrun()

    input:	none
    output:	pid found in pid file
    
    see t_chk4pid below
  • t_savpid(path2pidfile)

    input:	path to pid file
    output:	none
    
    saves the pid of the current process
    in the pid file (path2pidfile)
  • $pidpath = t_chk4pid(path)

    input:	path to pid file
    output:	undef or path to pid file
    
    checks for a process running with the pid
    found in "path". If the process is running
    return undef, otherwise return the "path".
    Always places the "pid" found in pid file
    into the variable "pidrun".
  • $pidpath = t_pidpath();

    input:	none
    output:	current pidpath/file
  • $err = t_init(home,...);

    input:	dbhome, arg1...argN
    output:	0 or error code
  • $err = t_dump(which, name);

      input:	0  = primary db
    	  or	nz = secondary db,
    		database name
    
    	this only works for specific
    	test sequence used in the 
    	test suite.
    
      output:	0 or error code
    
      prints database to STDOUT in the format
    	dot.quad.addr => timestamp
  • t_close();

    input:	none
    output:	none
    
    close the database files and environment
  • $data = t_get(which,addr,name);

      input:	0  = primary db
    	  or	nz = secondary db
    		database name
    
      output:	data (long)
    		or undef if not there
  • ($key,$data)=t_getrecno(which,name,cursor);

      input:	0  = primary db
    	  or	nz = secondary db
    		database name,
    		cursor (starting at 1)
    
      output:	key, data
  • $string = t_bdberror(status);

    input:	BDB status code
    output:	string representing the code
  • $version_string=t_bdbversion();

    input:	none
    output:	BDB version
  • $nrecords = t_bdbcount(name);

    input:	name of database
    output:	number of records in db

    NOTE: database must be open

EXPORT

None

AUTHOR

Michael Robinton <michael@bizsystems.com>

See also: files in subdirectory ./t