GnuCash
2.6.99
|
tools to set up random, but finanically consistent books. Create transactions with random values, random accounts, random account heirarchies, etc. More...
#include "config.h"
#include <sys/types.h>
#include <dirent.h>
#include <fcntl.h>
#include <glib.h>
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <qofinstance-p.h>
#include "Account.h"
#include "AccountP.h"
#include "gnc-engine.h"
#include "gnc-session.h"
#include "Transaction.h"
#include "TransactionP.h"
#include "Recurrence.h"
#include "SchedXaction.h"
#include "SX-book.h"
#include "test-engine-stuff.h"
#include "test-stuff.h"
#include "test-engine-strings.h"
Go to the source code of this file.
Data Structures | |
struct | TransInfo |
struct | KVPQueryData |
Macros | |
#define | RAND_IN_RANGE(X) (((X)*((gint64) (rand()+1)))/RAND_MAX) |
Enumerations | |
enum | sort_type_t { BY_STANDARD = 1, BY_DATE, BY_DATE_ENTERED, BY_DATE_RECONCILED, BY_NUM, BY_AMOUNT, BY_MEMO, BY_DESC, BY_NONE } |
Functions | |
void | set_max_account_tree_depth (gint max_tree_depth_in) |
void | set_max_accounts_per_level (gint max_level_accounts_in) |
void | set_max_kvp_depth (gint max_kvp_depth) |
void | set_max_kvp_frame_elements (gint max_kvp_frame_elements) |
void | kvp_exclude_type (KvpValueType kvp_type) |
void | random_glist_strings_only (gboolean strings_only) |
void | random_timespec_zero_nsec (gboolean zero_nsec_in) |
void | random_timespec_usec_resolution (gboolean usec_resolution_in) |
GList * | get_random_glist (void) |
Timespec * | get_random_timespec (void) |
GncGUID * | get_random_guid (void) |
KvpFrame * | get_random_kvp_frame (void) |
KvpValue * | get_random_kvp_value (int type) |
gnc_numeric | get_random_gnc_numeric (int64_t deno) |
const char * | get_random_commodity_namespace (void) |
gnc_commodity * | get_random_commodity (QofBook *book) |
void | make_random_changes_to_commodity (gnc_commodity *com) |
void | make_random_changes_to_commodity_table (gnc_commodity_table *table) |
void | make_random_changes_to_price (QofBook *book, GNCPrice *p) |
GNCPrice * | get_random_price (QofBook *book) |
gboolean | make_random_pricedb (QofBook *book, GNCPriceDB *db) |
GNCPriceDB * | get_random_pricedb (QofBook *book) |
void | make_random_changes_to_pricedb (QofBook *book, GNCPriceDB *pdb) |
Account * | get_random_account_tree (QofBook *book) |
void | make_random_changes_to_transaction_and_splits (QofBook *book, Transaction *trans, GList *accounts) |
void | make_random_changes_to_level (QofBook *book, Account *parent) |
Account * | get_random_account (QofBook *book) |
void | make_random_changes_to_account (QofBook *book, Account *account) |
Split * | get_random_split (QofBook *book, Account *acct, Transaction *trn) |
void | make_random_changes_to_split (Split *split) |
Transaction * | get_random_transaction_with_currency (QofBook *book, gnc_commodity *currency, GList *account_list) |
Transaction * | get_random_transaction (QofBook *book) |
void | make_random_changes_to_transaction (QofBook *book, Transaction *trans) |
QofQuery * | get_random_query (void) |
QofBook * | get_random_book (void) |
QofSession * | get_random_session (void) |
void | add_random_transactions_to_book (QofBook *book, gint num_transactions) |
void | make_random_changes_to_book (QofBook *book) |
void | make_random_changes_to_session (QofSession *session) |
void | trans_query_include_price (gboolean include_price_in) |
TestQueryTypes | get_random_query_type (void) |
QofQuery * | make_trans_query (Transaction *trans, TestQueryTypes query_types) |
SchedXaction * | add_daily_sx (gchar *name, const GDate *start, const GDate *end, const GDate *last_occur) |
SchedXaction * | add_once_sx (gchar *name, const GDate *when) |
void | remove_sx (SchedXaction *sx) |
Variables | |
gboolean | gnc_engine_debug_random = FALSE |
const char * | types [] |
tools to set up random, but finanically consistent books. Create transactions with random values, random accounts, random account heirarchies, etc.
XXX We should modify routines to create really, ugly, dirty transactions – 3 or more splits (TBD) – splits without parent accounts (done) – splits that have accounts but aren't in a transaction (TBD) – splits that share a currency with the transaction, but whose value doesn't equal amount (done)
Created by Linux Developers Group, 2001 Updates Linas Vepstas July 2004
Definition in file test-engine-stuff.c.
const char* types[] |
Definition at line 480 of file test-engine-stuff.c.