mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Testing: Unit tests for Split.c
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22127 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -2052,5 +2052,17 @@ gboolean xaccSplitRegister (void)
|
||||
return qof_object_register (&split_object_def);
|
||||
}
|
||||
|
||||
SplitTestFunctions*
|
||||
_utest_split_fill_functions (void)
|
||||
{
|
||||
SplitTestFunctions *func = g_new (SplitTestFunctions, 1);
|
||||
|
||||
func->xaccSplitEqualCheckBal = xaccSplitEqualCheckBal;
|
||||
func->get_currency_denom = get_currency_denom;
|
||||
func->get_commodity_denom = get_commodity_denom;
|
||||
func->get_corr_account_split = get_corr_account_split;
|
||||
return func;
|
||||
}
|
||||
|
||||
/************************ END OF ************************************\
|
||||
\************************* FILE *************************************/
|
||||
|
||||
@@ -238,6 +238,19 @@ void DxaccSplitSetShareAmount (Split *split, double amount);
|
||||
#define SET_GAINS_A_VDIRTY(s) SET_GAINS_DIRTY(s,GAINS_STATUS_A_VDIRTY);
|
||||
#define SET_GAINS_VDIRTY(s) SET_GAINS_DIRTY(s,GAINS_STATUS_VDIRTY);
|
||||
|
||||
/* Structure for accessing static functions for testing */
|
||||
typedef struct
|
||||
{
|
||||
gboolean (*xaccSplitEqualCheckBal) (const char *tag, gnc_numeric a,
|
||||
gnc_numeric b);
|
||||
int (*get_currency_denom) (const Split *s);
|
||||
int (*get_commodity_denom) (const Split *s);
|
||||
gboolean (*get_corr_account_split) (const Split *sa, const Split **retval);
|
||||
} SplitTestFunctions;
|
||||
|
||||
SplitTestFunctions* _utest_split_fill_functions (void);
|
||||
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
@@ -118,12 +118,16 @@ test_engine_SOURCES = \
|
||||
test_engine_HEADERS = \
|
||||
${top_srcdir}/${MODULEPATH}/gnc-engine.h
|
||||
|
||||
test_engine_LTLIBRARIES = \
|
||||
libutest-Split.la
|
||||
|
||||
test_enginedir = ${GNC_LIBEXECDIR}/${MODULEPATH}/test
|
||||
|
||||
test_engine_LDADD = \
|
||||
${top_builddir}/${MODULEPATH}/libgncmod-engine.la \
|
||||
${top_builddir}/src/libqof/qof/libgnc-qof.la \
|
||||
${top_builddir}/src/test-core/libtest-core.la
|
||||
${top_builddir}/src/libqof/qof/libgnc-qof.la \
|
||||
${top_builddir}/src/test-core/libtest-core.la \
|
||||
libutest-Split.la
|
||||
|
||||
|
||||
test_engine_CFLAGS = \
|
||||
@@ -132,6 +136,11 @@ test_engine_CFLAGS = \
|
||||
-DTESTPROG=test_engine \
|
||||
${GLIB_CFLAGS}
|
||||
|
||||
libutest_Split_la_SOURCES = \
|
||||
utest-Split.c \
|
||||
${top_srcdir}/src/libqof/qof/gnc-numeric.c
|
||||
|
||||
|
||||
clean-local:
|
||||
rm -f translog.*
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ main (int argc,
|
||||
test_suite_account();
|
||||
test_suite_gncInvoice();
|
||||
// test_suite_transaction();
|
||||
// test_suite_split();
|
||||
test_suite_split();
|
||||
|
||||
return g_test_run( );
|
||||
}
|
||||
|
||||
1791
src/engine/test/utest-Split.c
Normal file
1791
src/engine/test/utest-Split.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user