hi Derek,

sigh, you are right - I was working on the wrong report ID where the template name was #f.

Once you do it right it works like a charm.

Thanks for the eye opener.
/Carsten


On 12.03.2017 13:50, Derek Atkins wrote:
This error means the gnc:report-template-name function is returning #f.

-derek

Sent from my mobile. Please excuse any typos.

----- Reply message -----
From: "Carsten Rinke" <carsten.ri...@gmx.de>
To: "gnucash-devel" <gnucash-devel@gnucash.org>
Subject: How to get gnc:gettext binding to work isolated for the report system?
Date: Sun, Mar 12, 2017 7:54 AM

Hi,

I am trying to figure out how unit testing for the report system might
work, based on Glib-test.

The tests are run in the build/src/report/report-system/test
build-subdirectory, running make check.

Only the report system module is loaded by calling
gnc_module_load("gnucash/report/report-system", 0);

My understanding is that this automatically loads the modules for engine
and app-utils, too.

First tests for e.g. gnc:define-report are working now.

Now I get to procedures that include the call to gnc:gettext, which is
not working:
A call like
     (define rep-templ-name (gnc:gettext (gnc:report-template-name rep-templ)
ends up with
     ERROR: In procedure gnc-gettext-helper:
     ERROR: In procedure SWIG_Guile_scm2newstr: Wrong type argument in
position 1: #f

To me it seems that the SWIG binding towards gnc-gettext-helper (defined
in app-utils/gettext.scm) is not working with this test setup.

I tried to update report-system.i adding
      #include <gnc-gettext-util.h>
and
      char * gnc_gettext_helper(const char * str);
but after recompilation that does not show any effect, same error message.

Any idea how this binding could be resolved?

Thanks in advance,
Carsten

_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to