From 43094697306ec68c1133dfb11ef357bae8f473ca Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 19 Sep 2021 10:34:19 +0800 Subject: [PATCH] [utest-Account] test old dxaccAccount* functions dxaccAccountGetPriceSrc and dxaccAccountGetQuoteTZ. DxaccAccountSetCurrency remains untested - unsure how to retrieve an ISO4217 currency to use as parameter. --- libgnucash/engine/test/utest-Account.cpp | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libgnucash/engine/test/utest-Account.cpp b/libgnucash/engine/test/utest-Account.cpp index 2759c38f02..e7072e3943 100644 --- a/libgnucash/engine/test/utest-Account.cpp +++ b/libgnucash/engine/test/utest-Account.cpp @@ -1216,6 +1216,33 @@ test_gnc_account_kvp_setters_getters (Fixture *fixture, gconstpointer pData) xaccAccountSetNotes (account, nullptr); g_assert_cmpstr (xaccAccountGetNotes (account), ==, nullptr); + // STOCK_ACCOUNT tests from now on + xaccAccountSetType (account, ACCT_TYPE_STOCK); + + // dxaccAccountGetPriceSrc getter/setter + g_assert_cmpstr (dxaccAccountGetPriceSrc (account), ==, nullptr); + + dxaccAccountSetPriceSrc (account, "boo"); + g_assert_cmpstr (dxaccAccountGetPriceSrc (account), ==, "boo"); + + dxaccAccountSetPriceSrc (account, ""); + g_assert_cmpstr (dxaccAccountGetPriceSrc (account), ==, ""); + + dxaccAccountSetPriceSrc (account, nullptr); + g_assert_cmpstr (dxaccAccountGetPriceSrc (account), ==, nullptr); + + // dxaccAccountGetQuoteTZ getter/setter + g_assert_cmpstr (dxaccAccountGetQuoteTZ (account), ==, nullptr); + + dxaccAccountSetQuoteTZ (account, "boo"); + g_assert_cmpstr (dxaccAccountGetQuoteTZ (account), ==, "boo"); + + dxaccAccountSetQuoteTZ (account, ""); + g_assert_cmpstr (dxaccAccountGetQuoteTZ (account), ==, ""); + + dxaccAccountSetQuoteTZ (account, nullptr); + g_assert_cmpstr (dxaccAccountGetQuoteTZ (account), ==, nullptr); + xaccAccountBeginEdit (account); xaccAccountDestroy (account); }