[utest-Account] test old dxaccAccount* functions

dxaccAccountGetPriceSrc and dxaccAccountGetQuoteTZ.

DxaccAccountSetCurrency remains untested - unsure how to retrieve an
ISO4217 currency to use as parameter.
This commit is contained in:
Christopher Lam 2021-09-19 10:34:19 +08:00
parent 57cb8c193a
commit 4309469730

View File

@ -1216,6 +1216,33 @@ test_gnc_account_kvp_setters_getters (Fixture *fixture, gconstpointer pData)
xaccAccountSetNotes (account, nullptr); xaccAccountSetNotes (account, nullptr);
g_assert_cmpstr (xaccAccountGetNotes (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); xaccAccountBeginEdit (account);
xaccAccountDestroy (account); xaccAccountDestroy (account);
} }