include: remove some unused headers

test.h and usctest.h aren't used by anything.  Get rid of them.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Eric Biggers
2017-07-20 21:22:05 -07:00
committed by Eryu Guan
parent fb05a91808
commit fec7352230
2 changed files with 0 additions and 495 deletions
-192
View File
@@ -1,192 +0,0 @@
/*
* Copyright (c) 2000 Silicon Graphics, Inc.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* $Id: test.h,v 1.2 2005/11/09 02:50:19 nathans.longdrop.melbourne.sgi.com Exp $ */
#ifndef __TEST_H__
#define __TEST_H__
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#define TPASS 0 /* Test passed flag */
#define TFAIL 1 /* Test failed flag */
#define TBROK 2 /* Test broken flag */
#define TWARN 4 /* Test warning flag */
#define TRETR 8 /* Test retire flag */
#define TINFO 16 /* Test information flag */
#define TCONF 32 /* Test not appropriate for configuration flag */
/*
* Ensure that NUMSIGS is defined.
* It should be defined in signal.h or sys/signal.h on
* UNICOS/mk and IRIX systems. On UNICOS systems,
* it is not defined, thus it is being set to UNICOS's NSIG.
* Note: IRIX's NSIG (signals are 1-(NSIG-1))
* is not same meaning as UNICOS/UMK's NSIG (signals 1-NSIG)
*/
#ifndef NUMSIGS
#define NUMSIGS NSIG
#endif
/* defines for unexpected signal setup routine (set_usig.c) */
#define FORK 1 /* SIGCLD is to be ignored */
#define NOFORK 0 /* SIGCLD is to be caught */
#define DEF_HANDLER 0 /* tells set_usig() to use default signal handler */
/*
* The following defines are used to control tst_res and t_result reporting.
*/
#define TOUTPUT "TOUTPUT" /* The name of the environment variable */
/* that can be set to one of the following */
/* strings to control tst_res output */
/* If not set, TOUT_VERBOSE_S is assumed */
#define TOUT_VERBOSE_S "VERBOSE" /* All test cases reported */
#define TOUT_CONDENSE_S "CONDENSE" /* ranges are used where identical messages*/
/* occur for sequential test cases */
#define TOUT_NOPASS_S "NOPASS" /* No pass test cases are reported */
#define TOUT_DISCARD_S "DISCARD" /* No output is reported */
#define TST_NOBUF "TST_NOBUF" /* The name of the environment variable */
/* that can be set to control whether or not */
/* tst_res will buffer output into 4096 byte */
/* blocks of output */
/* If not set, buffer is done. If set, no */
/* internal buffering will be done in tst_res */
/* t_result does not have internal buffering */
/*
* The following defines are used to control tst_tmpdir, tst_wildcard and t_mkchdir
*/
#define TDIRECTORY "TDIRECTORY" /* The name of the environment variable */
/* that if is set, the value (directory) */
/* is used by all tests as their working */
/* directory. tst_rmdir and t_rmdir will */
/* not attempt to clean up. */
/* This environment variable should only */
/* be set when doing system testing since */
/* tests will collide and break and fail */
/* because of setting it. */
#define TEMPDIR "/tmp" /* This is the default temporary directory. */
/* The environment variable TMPDIR is */
/* used prior to this valid by tempnam(3). */
/* To control the base location of the */
/* temporary directory, set the TMPDIR */
/* environment variable to desired path */
/*
* The following contains support for error message passing.
* See test_error.c for details.
*/
#define TST_ERR_MESG_SIZE 1023 /* max size of error message */
#define TST_ERR_FILE_SIZE 511 /* max size of module name used by compiler */
#define TST_ERR_FUNC_SIZE 127 /* max size of func name */
typedef struct {
int te_line; /* line where last error was reported. Use */
/* "__LINE__" and let compiler do the rest */
int te_level; /* If set, will prevent current stored */
/* error to not be overwritten */
char te_func[TST_ERR_FUNC_SIZE+1]; /* name of function of last error */
/* Name of function or NULL */
char te_file[TST_ERR_FILE_SIZE+1]; /* module of last error. Use */
/* "__FILE__" and let compiler do the rest */
char te_mesg[TST_ERR_MESG_SIZE+1]; /* string of last error */
} _TST_ERROR;
extern _TST_ERROR Tst_error; /* defined in test_error.c */
#if __STDC__
extern void tst_set_error(char *file, int line, char *func, char *fmt, ...);
#else
extern void tst_set_error();
#endif
extern void tst_clear_error();
/*
* The following define contains the name of an environmental variable
* that can be used to specify the number of iterations.
* It is supported in parse_opts.c and USC_setup.c.
*/
#define USC_ITERATION_ENV "USC_ITERATIONS"
/*
* The following define contains the name of an environmental variable
* that can be used to specify to iteration until desired time
* in floating point seconds has gone by.
* Supported in USC_setup.c.
*/
#define USC_LOOP_WALLTIME "USC_LOOP_WALLTIME"
/*
* The following define contains the name of an environmental variable
* that can be used to specify that no functional checks are wanted.
* It is supported in parse_opts.c and USC_setup.c.
*/
#define USC_NO_FUNC_CHECK "USC_NO_FUNC_CHECK"
/*
* The following define contains the name of an environmental variable
* that can be used to specify the delay between each loop iteration.
* The value is in seconds (fractional numbers are allowed).
* It is supported in parse_opts.c.
*/
#define USC_LOOP_DELAY "USC_LOOP_DELAY"
/*
* The following prototypes are needed to remove compile errors
* on IRIX systems when compiled with -n32 and -64.
*/
extern void tst_res(int ttype, char *fname, char *arg_fmt, ...);
extern void tst_resm(int ttype, char *arg_fmt, ...);
extern void tst_brk(int ttype, char *fname, void (*func)(),
char *arg_fmt, ...);
extern void tst_brkloop(int ttype, char *fname, void (*func)(),
char *arg_fmt, ...);
extern void tst_brkm(int ttype, void (*func)(), char *arg_fmt, ...);
extern void tst_brkloopm(int ttype, void (*func)(), char *arg_fmt, ...);
extern int tst_environ();
extern void tst_exit();
extern void tst_flush();
/* prototypes for the t_res.c functions */
extern void t_result(char *tcid, int tnum, int ttype, char *tmesg);
extern void tt_exit();
extern int t_environ();
extern void t_breakum(char *tcid, int total, int typ, char *msg, void (*fnc)());
extern void tst_sig(int fork_flag, void (*handler)(), void (*cleanup)());
extern void tst_tmpdir();
extern void tst_rmdir();
extern char * get_high_address(void);
extern void get_kver(int*, int*, int*);
extern int tst_kvercmp(int, int, int);
#endif /* end of __TEST_H__ */
-303
View File
@@ -1,303 +0,0 @@
/*
* Copyright (c) 2000 Silicon Graphics, Inc.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* $Id: usctest.h,v 1.2 2005/11/09 02:50:19 nathans.longdrop.melbourne.sgi.com Exp $ */
/**********************************************************
*
* IRIX/Linux Feature Test and Evaluation - Silicon Graphics, Inc.
*
* FUNCTION NAME : usctest.h
*
* FUNCTION TITLE : System Call Test Macros
*
* SYNOPSIS:
* See DESCRIPTION below.
*
* AUTHOR : William Roske
*
* INITIAL RELEASE : UNICOS 7.0
*
* DESCRIPTION
* TEST(SCALL) - calls a system call
* TEST_VOID(SCALL) - same as TEST() but for syscalls with no return value.
* TEST_CLEANUP - print the log of errno return counts if STD_ERRNO_LOG
* is set.
* TEST_PAUSEF(HAND) - Pause for SIGUSR1 if the pause flag is set.
* Use "hand" as the interrupt handling function
* TEST_PAUSE - Pause for SIGUSR1 if the pause flag is set.
* Use internal function to do nothing on signal and go on.
* TEST_LOOPING(COUNTER) - Conditional to check if test should
* loop. Evaluates to TRUE (1) or FALSE (0).
* TEST_ERROR_LOG(eno) - log that this errno was received,
* if STD_ERRNO_LOG is set.
* TEST_EXP_ENOS(array) - set the bits in TEST_VALID_ENO array at
* positions specified in integer "array"
*
* RETURN VALUE
* TEST(SCALL) - Global Variables set:
* int TEST_RETURN=return code from SCALL
* int TEST_ERRNO=value of errno at return from SCALL
* TEST_VOID(SCALL) - Global Variables set:
* int TEST_ERRNO=value of errno at return from SCALL
* TEST_CLEANUP - None.
* TEST_PAUSEF(HAND) - None.
* TEST_PAUSE - None.
* TEST_LOOPING(COUNTER) - True if COUNTER < STD_LOOP_COUNT or
* STD_INFINITE is set.
* TEST_ERROR_LOG(eno) - None
* TEST_EXP_ENOS(array) - None
*
* KNOWN BUGS
* If you use the TEST_PAUSE or TEST_LOOPING macros, you must
* link in parse_opts.o, which contains the code for those functions.
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#ifndef __USCTEST_H__
#define __USCTEST_H__ 1
#ifndef _SC_CLK_TCK
#include <unistd.h>
#endif
#include <sys/param.h>
/*
* Ensure that PATH_MAX is defined
*/
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
#ifndef BSIZE
#define BSIZE BBSIZE
#endif
/***********************************************************************
* Define option_t structure type.
* Entries in this struct are used by the parse_opts routine
* to indicate valid options and return option arguments
***********************************************************************/
typedef struct {
char *option; /* Valid option string (one option only) like "a:" */
int *flag; /* pointer to location to set true if option given */
char **arg; /* pointer to location to place argument, if needed */
} option_t;
/***********************************************************************
* The following globals are defined in parse_opts.c but must be
* externed here because they are used in the macros defined below.
***********************************************************************/
extern int STD_FUNCTIONAL_TEST, /* turned off by -f to not do functional test */
STD_TIMING_ON, /* turned on by -t to print timing stats */
STD_PAUSE, /* turned on by -p to pause before loop */
STD_INFINITE, /* turned on by -i0 to loop forever */
STD_LOOP_COUNT, /* changed by -in to set loop count to n */
STD_ERRNO_LOG, /* turned on by -e to log errnos returned */
STD_ERRNO_LIST[], /* counts of errnos returned. indexed by errno */
STD_COPIES,
STD_argind;
extern float STD_LOOP_DURATION, /* wall clock time to iterate */
STD_LOOP_DELAY; /* delay time after each iteration */
#define USC_MAX_ERRNO 2000
/**********************************************************************
* Prototype for parse_opts routine
**********************************************************************/
extern char *parse_opts(int ac, char **av, option_t *user_optarr, void (*uhf)());
/*
* define a structure
*/
struct usc_errno_t {
int flag;
};
/***********************************************************************
****
****
****
**********************************************************************/
#ifdef _USC_LIB_
extern int TEST_RETURN;
extern int TEST_ERRNO;
#else
/***********************************************************************
* Global array of bit masks to indicate errnos that are expected.
* Bits set by TEST_EXP_ENOS() macro and used by TEST_CLEANUP() macro.
***********************************************************************/
struct usc_errno_t TEST_VALID_ENO[USC_MAX_ERRNO];
/***********************************************************************
* Globals for returning the return code and errno from the system call
* test macros.
***********************************************************************/
int TEST_RETURN;
int TEST_ERRNO;
/***********************************************************************
* temporary variables for determining max and min times in TEST macro
***********************************************************************/
long btime, etime, tmptime;
#endif /* _USC_LIB_ */
/***********************************************************************
* structure for timing accumulator and counters
***********************************************************************/
struct tblock {
long tb_max;
long tb_min;
long tb_total;
long tb_count;
};
/***********************************************************************
* The following globals are externed here so that they are accessable
* in the macros that follow.
***********************************************************************/
extern struct tblock tblock;
extern void STD_go();
extern int (*_TMP_FUNC)(void);
extern void STD_opts_help();
/***********************************************************************
* TEST: calls a system call
*
* parameters:
* SCALL = system call and parameters to execute
*
***********************************************************************/
#define TEST(SCALL) errno=0; TEST_RETURN = (unsigned) SCALL; TEST_ERRNO=errno;
/***********************************************************************
* TEST_VOID: calls a system call
*
* parameters:
* SCALL = system call and parameters to execute
*
* Note: This is IDENTICAL to the TEST() macro except that it is intended
* for use with syscalls returning no values (void syscall()). The
* Typecasting nothing (void) into an unsigned integer causes compilation
* errors.
*
***********************************************************************/
#define TEST_VOID(SCALL) errno=0; SCALL; TEST_ERRNO=errno;
/***********************************************************************
* TEST_CLEANUP: print system call timing stats and errno log entries
* to stdout if STD_TIMING_ON and STD_ERRNO_LOG are set, respectively.
* Do NOT print ANY information if no system calls logged.
*
* parameters:
* none
*
***********************************************************************/
#define TEST_CLEANUP \
if ( STD_ERRNO_LOG ) { \
for (tmptime=0; tmptime<USC_MAX_ERRNO; tmptime++) { \
if ( STD_ERRNO_LIST[tmptime] ) { \
if ( TEST_VALID_ENO[tmptime].flag ) \
tst_resm(TINFO, "ERRNO %d:\tReceived %d Times", \
tmptime, STD_ERRNO_LIST[tmptime]); \
else \
tst_resm(TINFO, \
"ERRNO %d:\tReceived %d Times ** UNEXPECTED **", \
tmptime, STD_ERRNO_LIST[tmptime]); \
} \
} \
}
/***********************************************************************
* TEST_PAUSEF: Pause for SIGUSR1 if the pause flag is set.
* Set the user specified function as the interrupt
* handler instead of "STD_go"
*
* parameters:
* none
*
***********************************************************************/
#define TEST_PAUSEF(HANDLER) \
if ( STD_PAUSE ) { \
_TMP_FUNC = (int (*)())signal(SIGUSR1, HANDLER); \
pause(); \
signal(SIGUSR1, (void (*)())_TMP_FUNC); \
}
/***********************************************************************
* TEST_PAUSE: Pause for SIGUSR1 if the pause flag is set.
* Just continue when signal comes in.
*
* parameters:
* none
*
***********************************************************************/
#define TEST_PAUSE usc_global_setup_hook();
int usc_global_setup_hook();
/***********************************************************************
* TEST_LOOPING now call the usc_test_looping function.
* The function will return 1 if the test should continue
* iterating.
*
***********************************************************************/
#define TEST_LOOPING usc_test_looping
int usc_test_looping(int counter);
/***********************************************************************
* TEST_ERROR_LOG(eno): log this errno if STD_ERRNO_LOG flag set
*
* parameters:
* int eno: the errno location in STD_ERRNO_LIST to log.
*
***********************************************************************/
#define TEST_ERROR_LOG(eno) \
if ( STD_ERRNO_LOG ) \
if ( eno < USC_MAX_ERRNO ) \
STD_ERRNO_LIST[eno]++; \
/***********************************************************************
* TEST_EXP_ENOS(array): set the bits associated with the nput errnos
* in the TEST_VALID_ENO array.
*
* parameters:
* int array[]: a zero terminated array of errnos expected.
*
***********************************************************************/
#define TEST_EXP_ENOS(array) \
tmptime=0; \
while (array[tmptime] != 0) { \
if (array[tmptime] < USC_MAX_ERRNO) \
TEST_VALID_ENO[array[tmptime]].flag=1; \
tmptime++; \
}
#endif /* end of __USCTEST_H__ */