00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 2 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * This program is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 * GNU General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA 00015 */ 00016 00017 00022 #ifndef TEST_ENGINE_STUFF_H 00023 #define TEST_ENGINE_STUFF_H 00024 00025 #include "config.h" 00026 00027 #include <glib.h> 00028 #include <stdlib.h> 00029 #include "config.h" 00030 #include "qofquery.h" 00031 #include "qoftime.h" 00032 #include "qofbook.h" 00033 #include "qofsession.h" 00034 00035 #ifndef QOF_DISABLE_DEPRECATED 00036 Timespec *get_random_timespec (void); 00037 void random_timespec_zero_nsec (gboolean zero_nsec); 00038 void random_timespec_usec_resolution (gboolean usec_resolution); 00039 #endif 00040 00041 kvp_value *get_random_kvp_value (gint type); 00042 00043 typedef struct 00044 { 00045 guchar *data; 00046 gint len; 00047 } bin_data; 00048 00049 bin_data *get_random_binary_data (void); 00050 00051 kvp_frame *get_random_kvp_frame (void); 00052 gnc_numeric get_random_gnc_numeric (void); 00053 GUID *get_random_guid (void); 00054 GList *get_random_glist (void); 00055 00056 void random_glist_strings_only (gboolean strings_only); 00057 void kvp_exclude_type (KvpValueType kvp_type); 00058 void set_max_kvp_depth (gint max_kvp_depth); 00059 void set_max_kvp_frame_elements (gint max_kvp_frame_elements); 00060 00061 typedef enum 00062 { 00063 RANDOM_QT = 0, 00064 SIMPLE_QT = 1 << 0, 00065 GUID_QT = 1 << 5, 00066 ALL_QT = (1 << 8) - 1 00067 } TestQueryTypes; 00068 00069 QofQuery *get_random_query (void); 00070 TestQueryTypes get_random_query_type (void); 00071 00072 QofBook *get_random_book (void); 00073 QofSession *get_random_session (void); 00074 00075 #endif