示例#1
0
static void
compare_single_tx( QofInstance* inst, gpointer user_data )
{
    CompareInfoStruct* info = (CompareInfoStruct*)user_data;
    Transaction* tx_1 = GNC_TRANS(inst);
    Transaction* tx_2 = xaccTransLookup( qof_instance_get_guid(inst), info->book_2 );

    if (!xaccTransEqual( tx_1, tx_2, TRUE, TRUE, TRUE, FALSE ))
    {
        info->result = FALSE;
    }
}
static gboolean
test_add_transaction (const char* tag, gpointer globaldata, gpointer data)
{
    Transaction* trans = static_cast<decltype (trans)> (data);
    tran_data* gdata = static_cast<decltype (gdata)> (globaldata);
    gboolean retval = TRUE;

    xaccTransBeginEdit (trans);
    xaccTransSetCurrency (trans, gdata->com);
    xaccTransCommitEdit (trans);

    if (!do_test_args (xaccTransEqual (gdata->trn, trans, TRUE, TRUE, TRUE, FALSE),
                       "gnc_transaction_sixtp_parser_create",
                       __FILE__, __LINE__,
                       "%d", gdata->value))
        retval = FALSE;

    gdata->new_trn = trans;

    return retval;
}