00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef TEST_STUFF_H
00035 #define TEST_STUFF_H
00036
00037 #include "config.h"
00038
00039 #include <glib.h>
00040 #include <stdlib.h>
00041
00048 #define do_test( result, title ) do_test_call( result, title, __FILE__, __LINE__ )
00049 #define success( title ) success_call( title, __FILE__, __LINE__ );
00050 #define failure( title ) failure_call( title, __FILE__, __LINE__ );
00051
00058
00059
00060
00061 gboolean do_test_call(
00062 gboolean result,
00063 const char* test_title,
00064 const char* filename,
00065 int line );
00066 gboolean do_test_args(
00067 gboolean result,
00068 const char* test_title,
00069 const char* filename,
00070 int line,
00071 const char* format, ... );
00072
00073
00077 void print_test_results(void);
00078
00088 void set_success_print( gboolean in_should_print );
00089
00090
00091 int get_rv(void);
00092
00097 void success_call(
00098 const char *test_title,
00099 const char *file,
00100 int line );
00101
00102 void success_args(
00103 const char *test_title,
00104 const char *file,
00105 int line,
00106 const char *format,
00107 ... );
00108
00109 void failure_call(
00110 const char *test_title,
00111 const char *file,
00112 int line);
00113
00114 void failure_args(
00115 const char *test_title,
00116 const char *file,
00117 int line,
00118 const char *format,
00119 ... );
00120
00121 gboolean get_random_boolean(void);
00122 gint get_random_int_in_range(int start, int end);
00123 void random_character_include_funky_chars (gboolean use_funky_chars);
00124 gchar get_random_character(void);
00125 gchar* get_random_string(void);
00126 gchar* get_random_string_without(const char *exclude_chars);
00127 gint64 get_random_gint64(void);
00128 double get_random_double(void);
00129 const char* get_random_string_in_array(const char* str_list[]);
00130
00131 #endif