includes/t_api.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2007,2009  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 1999-2001  Internet Software Consortium.
00004  *
00005  * Permission to use, copy, modify, and/or distribute this software for any
00006  * purpose with or without fee is hereby granted, provided that the above
00007  * copyright notice and this permission notice appear in all copies.
00008  *
00009  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00010  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00011  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00012  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00013  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00014  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00015  * PERFORMANCE OF THIS SOFTWARE.
00016  */
00017 
00018 /* $Id: t_api.h,v 1.4 2009/11/24 02:06:56 sar Exp $ */
00019 
00020 #ifndef TESTS_T_API_H
00021 #define TESTS_T_API_H 1
00022 
00025 #include <stdio.h>
00026 
00027 #include <omapip/result.h>
00028 #include <isc/lang.h>
00029 #include <isc/formatcheck.h>
00030 
00031 /*
00032  *
00033  * Result codes.
00034  *
00035  */
00036 
00037 #define T_PASS          0x1
00038 #define T_FAIL          0x2
00039 #define T_UNRESOLVED    0x3
00040 #define T_UNSUPPORTED   0x4
00041 #define T_UNTESTED      0x5
00042 #define T_THREADONLY    0x6
00043 
00044 /*
00045  *
00046  * Assertion class codes.
00047  *
00048  */
00049 
00050 #define T_OPTIONAL      0x0
00051 #define T_REQUIRED      0x1
00052 
00053 /*
00054  * Misc
00055  */
00056 
00057 #define T_MAXTOKS       16
00058 #define T_ARG(n)        (*(av + (n)))
00059 
00060 typedef void (*PFV)(void);
00061 
00062 typedef struct {
00063         PFV             pfv;
00064         const char      *func_name;
00065 } testspec_t;
00066 
00067 extern  int     T_debug;
00068 extern  testspec_t T_testlist[];
00069 
00070 ISC_LANG_BEGINDECLS
00071 
00072 void
00073 t_assert(const char *component, int anum, int class, const char *what, ...)
00074      ISC_FORMAT_PRINTF(4, 5);
00075 
00076 void
00077 t_info(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
00078 
00079 void
00080 t_result(int result);
00081 
00082 char *
00083 t_getenv(const char *name);
00084 
00085 char *
00086 t_fgetbs(FILE *fp);
00087 
00088 isc_result_t
00089 t_dns_result_fromtext(char *result);
00090 
00091 unsigned int
00092 t_dc_method_fromtext(char *dc_method);
00093 
00094 int
00095 t_bustline(char *line, char **toks);
00096 
00097 int
00098 t_eval(const char *filename, int (*func)(char **), int nargs);
00099 
00100 ISC_LANG_ENDDECLS
00101 
00102 #endif /* TESTS_T_API_H */
00103 

Generated on 5 Apr 2014 for ISC DHCP by  doxygen 1.6.1