QOF 0.8.4
test-engine-stuff.h
Go to the documentation of this file.
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 KvpValue *get_random_kvp_value (gint type);
00036 
00037 typedef struct
00038 {
00039     guchar *data;
00040     gint len;
00041 } bin_data;
00042 
00043 bin_data *get_random_binary_data (void);
00044 
00045 KvpFrame *get_random_kvp_frame (void);
00046 QofNumeric get_random_qof_numeric (void);
00047 GUID *get_random_guid (void);
00048 GList *get_random_glist (void);
00049 
00050 void random_glist_strings_only (gboolean strings_only);
00051 void kvp_exclude_type (KvpValueType kvp_type);
00052 void set_max_kvp_depth (gint max_kvp_depth);
00053 void set_max_kvp_frame_elements (gint max_kvp_frame_elements);
00054 
00055 typedef enum
00056 {
00057     RANDOM_QT = 0,
00058     SIMPLE_QT = 1 << 0,
00059     GUID_QT = 1 << 5,
00060     ALL_QT = (1 << 8) - 1
00061 } TestQueryTypes;
00062 
00063 QofQuery *get_random_query (void);
00064 TestQueryTypes get_random_query_type (void);
00065 
00066 QofBook *get_random_book (void);
00067 QofSession *get_random_session (void);
00068 
00069 #endif