gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Mon May 27 17:53:07 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/957df9a3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f76226f9 (commit)
	from  https://github.com/Gnucash/gnucash/commit/e557b021 (commit)



commit 957df9a32b6db7ef06c49f671183bf7c83521155
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon May 27 14:14:53 2019 -0700

    Add a +0000 offset to ISO8601 timestamps in the XML backend.
    
    Apparently GnuCash for Android hard-coded the offset spec into their
    parser, so it can't import XML files without it.

diff --git a/libgnucash/backend/xml/sixtp-dom-generators.cpp b/libgnucash/backend/xml/sixtp-dom-generators.cpp
index 4ddd0bf4c..d8a58eda0 100644
--- a/libgnucash/backend/xml/sixtp-dom-generators.cpp
+++ b/libgnucash/backend/xml/sixtp-dom-generators.cpp
@@ -140,6 +140,7 @@ time64_to_dom_tree (const char* tag, const time64 time)
     auto date_str = GncDateTime(time).format_iso8601();
     if (date_str.empty())
         return NULL;
+    date_str += " +0000"; //Tack on a UTC offset to mollify GnuCash for Android
     ret = xmlNewNode (NULL, BAD_CAST tag);
     xmlNewTextChild (ret, NULL, BAD_CAST "ts:date",
                      checked_char_cast (const_cast<char*>(date_str.c_str())));

commit f76226f912d40439712c489f9243049a1bc8d70a
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon May 27 14:50:51 2019 -0700

    Fix broken CSV Import tests.

diff --git a/gnucash/import-export/csv-imp/test/test-tokenizer.cpp b/gnucash/import-export/csv-imp/test/test-tokenizer.cpp
index b5b7fe0bd..97e4f47cf 100644
--- a/gnucash/import-export/csv-imp/test/test-tokenizer.cpp
+++ b/gnucash/import-export/csv-imp/test/test-tokenizer.cpp
@@ -144,7 +144,8 @@ TEST_F (GncTokenizerTest, tokenize_from_csv_file)
  * and parser option combinations.
  */
 void
-GncTokenizerTest::test_gnc_tokenize_helper (const std::string& separators, tokenize_csv_test_data* test_data)
+GncTokenizerTest::test_gnc_tokenize_helper (const std::string& separators,
+                                            tokenize_csv_test_data* test_data)
 {
 
     GncCsvTokenizer *csvtok = dynamic_cast<GncCsvTokenizer*>(csv_tok.get());
@@ -172,7 +173,7 @@ GncTokenizerTest::test_gnc_tokenize_helper (const std::string& separators, token
 
 static tokenize_csv_test_data comma_separated [] = {
         { "Date,Num,Description,Notes,Account,Deposit,Withdrawal,Balance", 8, { "Date","Num","Description","Notes","Account","Deposit","Withdrawal","Balance" } },
-        { "05/01/15,45,Typical csv import line - including quoted empty field,,Miscellaneous,\"\",\"1,100.00\",", 8, { "05/01/15","45","Acme Inc.","","Miscellaneous","","1,100.00","" } },
+        { "05/01/15,45,Typical csv import line - including quoted empty field,,Miscellaneous,\"\",\"1,100.00\",", 8, { "05/01/15","45","Typical csv import line - including quoted empty field","","Miscellaneous","","1,100.00","" } },
         { "05/01/15,45,Acme Inc.,,Miscellaneous,", 6, { "05/01/15","45","Acme Inc.","","Miscellaneous","",NULL,NULL } },
         { "Test\\ with backslash,nextfield", 2, { "Test\\ with backslash","nextfield",NULL,NULL,NULL,NULL,NULL,NULL } },
         { "Test with \\\" escaped quote,nextfield", 2, { "Test with \" escaped quote","nextfield",NULL,NULL,NULL,NULL,NULL,NULL } },
@@ -188,7 +189,7 @@ TEST_F (GncTokenizerTest, tokenize_comma_sep)
 
 static tokenize_csv_test_data semicolon_separated [] = {
         { "Date;Num;Description;Notes;Account;Deposit;Withdrawal;Balance", 8, { "Date","Num","Description","Notes","Account","Deposit","Withdrawal","Balance" } },
-        { "05/01/15;45;Typical csv import line - including quoted empty field;;Miscellaneous;\"\";\"1,100.00\";", 8, { "05/01/15","45","Acme Inc.","","Miscellaneous","","1,100.00","" } },
+        { "05/01/15;45;Typical csv import line - including quoted empty field;;Miscellaneous;\"\";\"1,100.00\";", 8, { "05/01/15","45","Typical csv import line - including quoted empty field","","Miscellaneous","","1,100.00","" } },
         { "05/01/15;45;Acme Inc.;;Miscellaneous;", 6, { "05/01/15","45","Acme Inc.","","Miscellaneous","",NULL,NULL } },
         { NULL, 0, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } },
 };



Summary of changes:
 gnucash/import-export/csv-imp/test/test-tokenizer.cpp | 7 ++++---
 libgnucash/backend/xml/sixtp-dom-generators.cpp       | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list