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 (gboolean result,
00062 const char *test_title,
00063 const char *filename, int line);
00064 gboolean do_test_args (gboolean result,
00065 const char *test_title,
00066 const char *filename,
00067 int line, const char *format, ...);
00068
00069
00073 void print_test_results (void);
00074
00084 void set_success_print (gboolean in_should_print);
00085
00086
00087 int get_rv (void);
00088
00093 void success_call (const char *test_title, const char *file, int line);
00094
00095 void success_args (const char *test_title,
00096 const char *file, int line, const char *format, ...);
00097
00098 void failure_call (const char *test_title, const char *file, int line);
00099
00100 void failure_args (const char *test_title,
00101 const char *file, int line, const char *format, ...);
00102
00103 gboolean get_random_boolean (void);
00104 gint get_random_int_in_range (int start, int end);
00105 void random_character_include_funky_chars (gboolean use_funky_chars);
00106 gchar get_random_character (void);
00107 gchar *get_random_string (void);
00108 gchar *get_random_string_without (const char *exclude_chars);
00109 gint64 get_random_gint64 (void);
00110 double get_random_double (void);
00111 const char *get_random_string_in_array (const char *str_list[]);
00112
00113 #endif