mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix business-core tests so that all pass
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19754 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
d40faca9f9
commit
88b0e265b6
@ -161,9 +161,11 @@ test_string_fcn (QofBook *book, const char *message,
|
||||
do_test (!gncCustomerIsDirty (customer), "test if start dirty");
|
||||
gncCustomerBeginEdit (customer);
|
||||
set (customer, str);
|
||||
/* Customer record should be dirty */
|
||||
do_test (gncCustomerIsDirty (customer), "test dirty later");
|
||||
gncCustomerCommitEdit (customer);
|
||||
do_test (gncCustomerIsDirty (customer), "test dirty after commit");
|
||||
/* Customer record should be not dirty */
|
||||
do_test (!gncCustomerIsDirty (customer), "test dirty after commit");
|
||||
do_test (safe_strcmp (get (customer), str) == 0, message);
|
||||
gncCustomerSetActive (customer, FALSE);
|
||||
count++;
|
||||
@ -180,9 +182,11 @@ test_numeric_fcn (QofBook *book, const char *message,
|
||||
do_test (!gncCustomerIsDirty (customer), "test if start dirty");
|
||||
gncCustomerBeginEdit (customer);
|
||||
set (customer, num);
|
||||
/* Customer record should be dirty */
|
||||
do_test (gncCustomerIsDirty (customer), "test dirty later");
|
||||
gncCustomerCommitEdit (customer);
|
||||
do_test (gncCustomerIsDirty (customer), "test dirty after commit");
|
||||
/* Customer record should be not dirty */
|
||||
do_test (!gncCustomerIsDirty (customer), "test dirty after commit");
|
||||
do_test (gnc_numeric_equal (get (customer), num), message);
|
||||
gncCustomerSetActive (customer, FALSE);
|
||||
count++;
|
||||
@ -201,9 +205,11 @@ test_bool_fcn (QofBook *book, const char *message,
|
||||
set (customer, FALSE);
|
||||
set (customer, TRUE);
|
||||
set (customer, num);
|
||||
/* Customer record should be dirty */
|
||||
do_test (gncCustomerIsDirty (customer), "test dirty later");
|
||||
gncCustomerCommitEdit (customer);
|
||||
do_test (gncCustomerIsDirty (customer), "test dirty after commit");
|
||||
/* Customer record should be not dirty */
|
||||
do_test (!gncCustomerIsDirty (customer), "test dirty after commit");
|
||||
do_test (get (customer) == num, message);
|
||||
gncCustomerSetActive (customer, FALSE);
|
||||
count++;
|
||||
@ -215,9 +221,13 @@ main (int argc, char **argv)
|
||||
qof_init();
|
||||
qof_load_backend_library ("../../../backend/xml/.libs/", GNC_LIB_NAME);
|
||||
do_test (cashobjects_register(), "Cannot register cash objects");
|
||||
/* These three registrations are done during cashobjects_register,
|
||||
so trying to register them again naturally fails. */
|
||||
#if 0
|
||||
do_test (gncInvoiceRegister(), "Cannot register GncInvoice");
|
||||
do_test (gncJobRegister (), "Cannot register GncJob");
|
||||
do_test (gncCustomerRegister(), "Cannot register GncCustomer");
|
||||
#endif
|
||||
test_customer();
|
||||
print_test_results();
|
||||
qof_close ();
|
||||
|
@ -151,9 +151,11 @@ test_string_fcn (QofBook *book, const char *message,
|
||||
do_test (!gncEmployeeIsDirty (employee), "test if start dirty");
|
||||
gncEmployeeBeginEdit (employee);
|
||||
set (employee, str);
|
||||
/* Employee record should be dirty */
|
||||
do_test (gncEmployeeIsDirty (employee), "test dirty later");
|
||||
gncEmployeeCommitEdit (employee);
|
||||
do_test (gncEmployeeIsDirty (employee), "test dirty after commit");
|
||||
/* Employee record should be not dirty */
|
||||
do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
|
||||
do_test (safe_strcmp (get (employee), str) == 0, message);
|
||||
gncEmployeeSetActive (employee, FALSE);
|
||||
count++;
|
||||
@ -170,9 +172,11 @@ test_numeric_fcn (QofBook *book, const char *message,
|
||||
do_test (!gncEmployeeIsDirty (employee), "test if start dirty");
|
||||
gncEmployeeBeginEdit (employee);
|
||||
set (employee, num);
|
||||
/* Employee record should be dirty */
|
||||
do_test (gncEmployeeIsDirty (employee), "test dirty later");
|
||||
gncEmployeeCommitEdit (employee);
|
||||
do_test (gncEmployeeIsDirty (employee), "test dirty after commit");
|
||||
/* Employee record should be not dirty */
|
||||
do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
|
||||
do_test (gnc_numeric_equal (get (employee), num), message);
|
||||
gncEmployeeSetActive (employee, FALSE);
|
||||
count++;
|
||||
@ -191,9 +195,11 @@ test_bool_fcn (QofBook *book, const char *message,
|
||||
set (employee, FALSE);
|
||||
set (employee, TRUE);
|
||||
set (employee, num);
|
||||
/* Employee record should be dirty */
|
||||
do_test (gncEmployeeIsDirty (employee), "test dirty later");
|
||||
gncEmployeeCommitEdit (employee);
|
||||
do_test (gncEmployeeIsDirty (employee), "test dirty after commit");
|
||||
/* Employee record should be not dirty */
|
||||
do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
|
||||
do_test (get (employee) == num, message);
|
||||
gncEmployeeSetActive (employee, FALSE);
|
||||
count++;
|
||||
@ -211,8 +217,10 @@ test_gint_fcn (QofBook *book, const char *message,
|
||||
do_test (!gncEmployeeIsDirty (employee), "test if start dirty");
|
||||
gncEmployeeBeginEdit (employee);
|
||||
set (employee, num);
|
||||
/* Employee record should be dirty */
|
||||
do_test (gncEmployeeIsDirty (employee), "test dirty later");
|
||||
gncEmployeeCommitEdit (employee);
|
||||
/* Employee record should be not dirty */
|
||||
do_test (!gncEmployeeIsDirty (employee), "test dirty after commit");
|
||||
do_test (get (employee) == num, message);
|
||||
gncEmployeeSetActive (employee, FALSE);
|
||||
|
@ -171,9 +171,11 @@ test_string_fcn (QofBook *book, const char *message,
|
||||
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test if start dirty");
|
||||
gncJobBeginEdit (job);
|
||||
set (job, str);
|
||||
/* Job record should be dirty */
|
||||
do_test (qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty later");
|
||||
gncJobCommitEdit (job);
|
||||
do_test (qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
|
||||
/* Job record should be not dirty */
|
||||
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
|
||||
do_test (safe_strcmp (get (job), str) == 0, message);
|
||||
gncJobSetActive (job, FALSE);
|
||||
count++;
|
||||
@ -191,8 +193,10 @@ test_numeric_fcn (QofBook *book, const char *message,
|
||||
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test if start dirty");
|
||||
gncJobBeginEdit (job);
|
||||
set (job, num);
|
||||
/* Job record should be dirty */
|
||||
do_test (qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty later");
|
||||
gncJobCommitEdit (job);
|
||||
/* Job record should be not dirty */
|
||||
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
|
||||
do_test (gnc_numeric_equal (get (job), num), message);
|
||||
gncJobSetActive (job, FALSE);
|
||||
@ -213,9 +217,11 @@ test_bool_fcn (QofBook *book, const char *message,
|
||||
set (job, FALSE);
|
||||
set (job, TRUE);
|
||||
set (job, num);
|
||||
/* Job record should be dirty */
|
||||
do_test (qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty later");
|
||||
gncJobCommitEdit (job);
|
||||
do_test (qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
|
||||
/* Job record should be not dirty */
|
||||
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
|
||||
do_test (get (job) == num, message);
|
||||
gncJobSetActive (job, FALSE);
|
||||
count++;
|
||||
@ -233,8 +239,10 @@ test_gint_fcn (QofBook *book, const char *message,
|
||||
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test if start dirty");
|
||||
gncJobBeginEdit (job);
|
||||
set (job, num);
|
||||
/* Job record should be dirty */
|
||||
do_test (qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty later");
|
||||
gncJobCommitEdit (job);
|
||||
/* Job record should be not dirty */
|
||||
do_test (!qof_instance_is_dirty (QOF_INSTANCE(job)), "test dirty after commit");
|
||||
do_test (get (job) == num, message);
|
||||
gncJobSetActive (job, FALSE);
|
||||
|
@ -150,9 +150,11 @@ test_string_fcn (QofBook *book, const char *message,
|
||||
do_test (!gncVendorIsDirty (vendor), "test if start dirty");
|
||||
gncVendorBeginEdit (vendor);
|
||||
set (vendor, str);
|
||||
/* Vendor record should be dirty */
|
||||
do_test (gncVendorIsDirty (vendor), "test dirty later");
|
||||
gncVendorCommitEdit (vendor);
|
||||
do_test (gncVendorIsDirty (vendor), "test dirty after commit");
|
||||
/* Vendor record should be not dirty */
|
||||
do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
|
||||
do_test (safe_strcmp (get (vendor), str) == 0, message);
|
||||
gncVendorSetActive (vendor, FALSE);
|
||||
count++;
|
||||
@ -170,8 +172,10 @@ test_numeric_fcn (QofBook *book, const char *message,
|
||||
do_test (!gncVendorIsDirty (vendor), "test if start dirty");
|
||||
gncVendoryBeginEdit (vendor);
|
||||
set (vendor, num);
|
||||
/* Vendor record should be dirty */
|
||||
do_test (gncVendorIsDirty (vendor), "test dirty later");
|
||||
gncVendorCommitEdit (vendor);
|
||||
/* Vendor record should be not dirty */
|
||||
do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
|
||||
do_test (gnc_numeric_equal (get (vendor), num), message);
|
||||
gncVendorSetActive (vendor, FALSE);
|
||||
@ -192,9 +196,11 @@ test_bool_fcn (QofBook *book, const char *message,
|
||||
set (vendor, FALSE);
|
||||
set (vendor, TRUE);
|
||||
set (vendor, num);
|
||||
/* Vendor record should be dirty */
|
||||
do_test (gncVendorIsDirty (vendor), "test dirty later");
|
||||
gncVendorCommitEdit (vendor);
|
||||
do_test (gncVendorIsDirty (vendor), "test dirty after commit");
|
||||
/* Vendor record should be not dirty */
|
||||
do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
|
||||
do_test (get (vendor) == num, message);
|
||||
gncVendorSetActive (vendor, FALSE);
|
||||
count++;
|
||||
@ -212,8 +218,10 @@ test_gint_fcn (QofBook *book, const char *message,
|
||||
do_test (!gncVendorIsDirty (vendor), "test if start dirty");
|
||||
gncVendorBeginEdit (vendor);
|
||||
set (vendor, num);
|
||||
/* Vendor record should be dirty */
|
||||
do_test (gncVendorIsDirty (vendor), "test dirty later");
|
||||
gncVendorCommitEdit (vendor);
|
||||
/* Vendor record should be not dirty */
|
||||
do_test (!gncVendorIsDirty (vendor), "test dirty after commit");
|
||||
do_test (get (vendor) == num, message);
|
||||
gncVendorSetActive (vendor, FALSE);
|
||||
|
Loading…
Reference in New Issue
Block a user