r22136 - gnucash/trunk/src/engine/test - [Testing] Fix a missed execution path detected with error message counting.
John Ralls
jralls at code.gnucash.org
Tue Apr 3 17:35:58 EDT 2012
Author: jralls
Date: 2012-04-03 17:35:58 -0400 (Tue, 03 Apr 2012)
New Revision: 22136
Trac: http://svn.gnucash.org/trac/changeset/22136
Modified:
gnucash/trunk/src/engine/test/utest-Split.c
Log:
[Testing] Fix a missed execution path detected with error message counting.
Modified: gnucash/trunk/src/engine/test/utest-Split.c
===================================================================
--- gnucash/trunk/src/engine/test/utest-Split.c 2012-04-03 21:35:47 UTC (rev 22135)
+++ gnucash/trunk/src/engine/test/utest-Split.c 2012-04-03 21:35:58 UTC (rev 22136)
@@ -429,6 +429,7 @@
test_add_error (&checkA);
test_add_error (&checkB);
test_add_error (&checkC);
+ test_add_error (&checkD);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_list_handler, &checkA);
hdlr = g_log_set_handler (logdomain, loglevel,
@@ -499,6 +500,21 @@
g_assert_cmpint (checkB.hits, ==, 4);
g_assert_cmpint (checkC.hits, ==, 2);
g_assert_cmpint (checkD.hits, ==, 0);
+
+ split2->balance = fixture->split->balance;
+ g_assert (xaccSplitEqual (fixture->split, split2, TRUE, TRUE, TRUE) == FALSE);
+ g_assert_cmpint (checkA.hits, ==, 12);
+ g_assert_cmpint (checkB.hits, ==, 4);
+ g_assert_cmpint (checkC.hits, ==, 4);
+ g_assert_cmpint (checkD.hits, ==, 0);
+
+ split2->cleared_balance = fixture->split->cleared_balance;
+ g_assert (xaccSplitEqual (fixture->split, split2, TRUE, TRUE, TRUE) == FALSE);
+ g_assert_cmpint (checkA.hits, ==, 12);
+ g_assert_cmpint (checkB.hits, ==, 4);
+ g_assert_cmpint (checkC.hits, ==, 4);
+ g_assert_cmpint (checkD.hits, ==, 2);
+
test_clear_error_list ();
g_assert (xaccSplitEqual (fixture->split, split2, TRUE, FALSE, TRUE) == TRUE);
g_object_unref (split1);
More information about the gnucash-changes
mailing list