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 Library 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 00030 #include "qofquery.h" 00031 #include "gnc-date.h" 00032 #include "qofbook.h" 00033 #include "qofsession.h" 00034 00035 Timespec* get_random_timespec(void); 00036 void random_timespec_zero_nsec (gboolean zero_nsec); 00037 void random_timespec_usec_resolution (gboolean usec_resolution); 00038 00039 kvp_value* get_random_kvp_value(int type); 00040 00041 typedef struct 00042 { 00043 guchar *data; 00044 int len; 00045 } bin_data; 00046 00047 bin_data* get_random_binary_data(void); 00048 00049 kvp_frame* get_random_kvp_frame(void); 00050 gnc_numeric get_random_gnc_numeric(void); 00051 GUID* get_random_guid(void); 00052 GList* get_random_glist(void); 00053 00054 void random_glist_strings_only (gboolean strings_only); 00055 void kvp_exclude_type (KvpValueType kvp_type); 00056 void set_max_kvp_depth (gint max_kvp_depth); 00057 void set_max_kvp_frame_elements (gint max_kvp_frame_elements); 00058 00059 typedef enum 00060 { 00061 RANDOM_QT = 0, 00062 SIMPLE_QT = 1 << 0, 00063 GUID_QT = 1 << 5, 00064 ALL_QT = (1 << 8) - 1 00065 } TestQueryTypes; 00066 00067 QofQuery * get_random_query(void); 00068 TestQueryTypes get_random_query_type (void); 00069 00070 QofBook * get_random_book (void); 00071 QofSession * get_random_session (void); 00072 00073 #endif