[Transaction.c] use heuristics to determine txn->txn_type

This commit is contained in:
Christopher Lam
2022-06-15 19:43:20 +08:00
parent aa43c198c6
commit fd12d3900c
5 changed files with 48 additions and 29 deletions

View File

@@ -1838,13 +1838,8 @@ test_xaccTransGetReadOnly (Fixture *fixture, gconstpointer pData)
static void
test_xaccTransGetTxnType (Fixture *fixture, gconstpointer pData)
{
const char i = 'I';
const char p = 'P';
auto txn = fixture->txn;
xaccTransSetTxnType(txn, i);
g_assert_cmpint (i, ==, xaccTransGetTxnType(txn));
xaccTransSetTxnType(txn, p);
g_assert_cmpint (p, ==, xaccTransGetTxnType(txn));
g_assert_cmpint (TXN_TYPE_NONE, ==, xaccTransGetTxnType(txn));
}
/* xaccTransGetReadOnly C: 7 in 5 Local: 1:0:0