GNOME Bugzilla – Bug 794137
2.7.5: test failure: 60 - test-gnc-numeric
Last modified: 2018-06-30 00:05:20 UTC
From Debian "unstable" on amd64: ~~~~ 60/107 Testing: test-gnc-numeric 60/107 Test: test-gnc-numeric Command: "/build/gnucash-2.7.5/.build/bin/test-gnc-numeric" Directory: /build/gnucash-2.7.5/.build/libgnucash/engine/test "test-gnc-numeric" start time: Mar 06 03:21 UTC Output: ---------------------------------------------------------- Running main() from gtest_main.cc [==========] Running 22 tests from 6 test cases. [----------] Global test environment set-up. [----------] 7 tests from gncnumeric_constructors [ RUN ] gncnumeric_constructors.test_default_constructor [ OK ] gncnumeric_constructors.test_default_constructor (0 ms) [ RUN ] gncnumeric_constructors.test_gnc_rational_constructor [ OK ] gncnumeric_constructors.test_gnc_rational_constructor (0 ms) [ RUN ] gncnumeric_constructors.test_gnc_numeric_constructor [ OK ] gncnumeric_constructors.test_gnc_numeric_constructor (0 ms) [ RUN ] gncnumeric_constructors.test_int64_constructor [ OK ] gncnumeric_constructors.test_int64_constructor (0 ms) [ RUN ] gncnumeric_constructors.test_implicit_int_constructor [ OK ] gncnumeric_constructors.test_implicit_int_constructor (0 ms) [ RUN ] gncnumeric_constructors.test_double_constructor [ OK ] gncnumeric_constructors.test_double_constructor (0 ms) [ RUN ] gncnumeric_constructors.test_string_constructor [ OK ] gncnumeric_constructors.test_string_constructor (0 ms) [----------] 7 tests from gncnumeric_constructors (0 ms total) [----------] 1 test from gncnumeric_output [ RUN ] gncnumeric_output.string_output [ OK ] gncnumeric_output.string_output (0 ms) [----------] 1 test from gncnumeric_output (0 ms total) [----------] 2 tests from gncnumeric_stream [ RUN ] gncnumeric_stream.output_stream /build/gnucash-2.7.5/libgnucash/engine/test/gtest-gnc-numeric.cpp:219: Failure Expected: "123 456" To be equal to: output.str() Which is: "123\xE2" "456" [ FAILED ] gncnumeric_stream.output_stream (1 ms) [ RUN ] gncnumeric_stream.input_stream [ OK ] gncnumeric_stream.input_stream (0 ms) [----------] 2 tests from gncnumeric_stream (1 ms total) ----------] 6 tests from gncnumeric_operators [ RUN ] gncnumeric_operators.gnc_numeric_conversion [ OK ] gncnumeric_operators.gnc_numeric_conversion (0 ms) [ RUN ] gncnumeric_operators.double_conversion [ OK ] gncnumeric_operators.double_conversion (0 ms) [ RUN ] gncnumeric_operators.test_addition [ OK ] gncnumeric_operators.test_addition (0 ms) [ RUN ] gncnumeric_operators.test_subtraction [ OK ] gncnumeric_operators.test_subtraction (0 ms) [ RUN ] gncnumeric_operators.test_multiplication [ OK ] gncnumeric_operators.test_multiplication (0 ms) [ RUN ] gncnumeric_operators.test_division [ OK ] gncnumeric_operators.test_division (0 ms) [----------] 6 tests from gncnumeric_operators (0 ms total) [----------] 4 tests from gncnumeric_functions [ RUN ] gncnumeric_functions.test_cmp [ OK ] gncnumeric_functions.test_cmp (0 ms) [ RUN ] gncnumeric_functions.test_invert [ OK ] gncnumeric_functions.test_invert (0 ms) [ RUN ] gncnumeric_functions.test_reduce [ OK ] gncnumeric_functions.test_reduce (0 ms) [ RUN ] gncnumeric_functions.test_convert [ OK ] gncnumeric_functions.test_convert (0 ms) [----------] 4 tests from gncnumeric_functions (0 ms total) [----------] 2 tests from gnc_numeric_functions [ RUN ] gnc_numeric_functions.test_is_decimal [ OK ] gnc_numeric_functions.test_is_decimal (0 ms) [ RUN ] gnc_numeric_functions.test_conversion_to_decimal [ OK ] gnc_numeric_functions.test_conversion_to_decimal (0 ms) [----------] 2 tests from gnc_numeric_functions (0 ms total) [----------] Global test environment tear-down [==========] 22 tests from 6 test cases ran. (1 ms total) [ PASSED ] 21 tests. [ FAILED ] 1 test, listed below: [ FAILED ] gncnumeric_stream.output_stream 1 FAILED TEST <end of output> Test time = 0.00 sec ---------------------------------------------------------- Test Failed. "test-gnc-numeric" end time: Mar 06 03:21 UTC "test-gnc-numeric" time elapsed: 00:00:00 ~~~~
What have you set LC_CHARSET to?
Never mind. The problem seems to be that the French thousands separator got changed to U202f (a non-breaking space). The wchar_t version returns the right value but the char version returns only the first byte, 0xe2, of the three UTF-8 chars. That's a violation of the standard, so it's a libstdc++ bug. In glibc they changed it only last August. I imagine that libstdc++ just uses the same file and they may not even realize that it doesn't work for C++.
Thanks. I think LC_CHARSET is not defined.
Fixed by overloading operator<<(std::ostream&, GncNumeric) to call operator<<(std::wostream&, GncNumeric) and convert the result to utf8.
Thanks! Is there a patch I could use with 2.7.5? I couldn't find the relevant commit in repository...
It's https://github.com/Gnucash/gnucash/commit/c3180ab374ad9a2c2c0861b85c85299fe9bc16fb OTOH I'll be releasing 2.7.6 in a few hours.
Thank you. 2.7.6 builds much better :) https://buildd.debian.org/status/package.php?p=gnucash&suite=experimental
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=794137. Please update any external references or bookmarks.