Package: gnucash
Version: 1:2.6.17-1
Severity: serious
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu artful ubuntu-patch

Hi Dmitry,

The gnucash package has been failing to build in Ubuntu with a test failure,
and I have reproduced this failure in Debian unstable:

  /engine/Transaction/xaccTransScrubGainsDate_gains_dirty:             **
ERROR:utest-Transaction.c:452:test_gnc_transaction_set_get_property: assertion 
failed (check1->hits == 1): (0 == 1)
<INFO> (gnc.engine) [xaccSplitEqualCheckBal] balances differ: 100000/1000 vs 
200000/1000
<FATAL WARNING> (GLib-GObject) g_object_set_is_valid_property: object class 
'Transaction' has no property named 'bogus'
<FATAL WARNING> (GLib-GObject) g_object_set_is_valid_property: object class 
'Transaction' has no property named 'bogus'
OK
  /engine/Transaction/gnc transaction set/get property:                FAIL
GTester: last random seed: R02Sa8a1794f6622116b0a513984cbbbcc0f
Makefile:1926: recipe for target 'test-nonrecursive' failed
make[7]: *** [test-nonrecursive] Terminated

  https://launchpad.net/ubuntu/+source/gnucash/1:2.6.17-1/+build/13058180

This looks like a brittle test that has broken as a result of implementation
details in gobject; I don't see any reason why the gnucash test suite should
be testing the specific text of the error message returned by gobject when
performing a disallowed operation.  The gnucash implementation never relies
on the contents of this error string anywhere else, and it's not the
business of the gnucash testsuite to be testing the behavior of gobject
instead of its own.

So I think this particular test (or this aspect of the test) should be
dropped.  But in the meantime, here is a patch that fixes the test failure
on Debian and Ubuntu.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru gnucash-2.6.17/debian/patches/fix-test-for-gobject-messages.patch 
gnucash-2.6.17/debian/patches/fix-test-for-gobject-messages.patch
--- gnucash-2.6.17/debian/patches/fix-test-for-gobject-messages.patch   
1969-12-31 16:00:00.000000000 -0800
+++ gnucash-2.6.17/debian/patches/fix-test-for-gobject-messages.patch   
2017-09-20 11:43:37.000000000 -0700
@@ -0,0 +1,31 @@
+Description: fix test case to work with newer gobject
+ glib 2.54 changes the error string returned by a particular wrong call
+ to g_object_set().  gnucash's testsuite relies on matching the exact
+ text of this error string.  This is a wrong thing for the testsuite to do
+ - nothing in gnucash outside of the testsuite relies on this behavior, and
+ it's testing behavior of glib not of gnucash - but for the moment, here is
+ a patch that updates the expected string to match current glib.
+Author: Steve Langasek <steve.langa...@ubuntu.com>
+
+Index: gnucash-2.6.17/src/engine/test/utest-Transaction.c
+===================================================================
+--- gnucash-2.6.17.orig/src/engine/test/utest-Transaction.c
++++ gnucash-2.6.17/src/engine/test/utest-Transaction.c
+@@ -412,7 +412,7 @@
+                           "GNR", "", 240), *t_curr = NULL;
+     Timespec now = timespec_now (), *t_entered = NULL, *t_posted = NULL;
+     time_t secs = (time_t)now.tv_sec;
+-    gchar *msg1 = "g_object_set_valist: object class " _Q "Transaction' has 
no property named " _Q "bogus'";
++    gchar *msg1 = "g_object_set_is_valid_property: object class " _Q 
"Transaction' has no property named " _Q "bogus'";
+     gchar *msg2 = g_strdup_printf ("[xaccTransSetDateInternal] addr=%p set 
date to %" G_GUINT64_FORMAT ".%09ld %s",
+                                    txn, now.tv_sec, now.tv_nsec, ctime 
(&secs));
+     GLogLevelFlags loglevel1 = G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL;
+@@ -453,7 +453,7 @@
+     g_assert_cmpint (check2->hits, ==, 2);
+ 
+     g_free (check1->msg);
+-    check1->msg = g_strdup ("g_object_get_valist: object class " _Q 
"Transaction' has no property named " _Q "bogus'");
++    check1->msg = g_strdup ("g_object_get_is_valid_property: object class " 
_Q "Transaction' has no property named " _Q "bogus'");
+     g_object_get (G_OBJECT (txn),
+                   "num", &t_num,
+                   "description", &t_desc,
diff -Nru gnucash-2.6.17/debian/patches/series 
gnucash-2.6.17/debian/patches/series
--- gnucash-2.6.17/debian/patches/series        2016-12-21 13:24:42.000000000 
-0800
+++ gnucash-2.6.17/debian/patches/series        2017-09-20 11:19:43.000000000 
-0700
@@ -1 +1,2 @@
 hardening-fortify.patch
+fix-test-for-gobject-messages.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to