From 2cd33e3b8328010ef3009b1c0504f94acc6daa3b Mon Sep 17 00:00:00 2001 From: Jon Meredith Date: Thu, 12 Feb 2009 11:13:58 -0700 Subject: [PATCH] Added test for transaction/2 once bug 818 is resolved. --- test/bdberl_SUITE.erl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/bdberl_SUITE.erl b/test/bdberl_SUITE.erl index 8f99c23..ff20563 100644 --- a/test/bdberl_SUITE.erl +++ b/test/bdberl_SUITE.erl @@ -21,6 +21,7 @@ all() -> transaction_should_commit_on_success, transaction_should_abort_on_exception, transaction_should_abort_on_user_abort, + transaction_error_should_return_error, update_should_save_value_if_successful, update_should_accept_args_for_fun, port_should_tune_transaction_timeouts, @@ -58,7 +59,6 @@ end_per_testcase(_TestCase, Config) -> ok = bdberl:close(?config(db, Config)), ok = bdberl:delete_database("api_test.db"). - open_should_create_database_if_none_exists(Config) -> DbName = filename:join([?config(priv_dir, Config), "api_test.db"]), true = filelib:is_file(DbName). @@ -120,6 +120,20 @@ transaction_should_abort_on_user_abort(Config) -> {error, transaction_aborted} = bdberl:transaction(F), not_found = bdberl:get(Db, mykey). +transaction_error_should_return_error(Config) -> + {skip, waiting_on_bug_818}. +%% Db = ?config(db, Config), +%% F = fun() -> +%% bdberl:put(Db, mykey, should_not_see_this), +%% %% Explicitly kill the transaction so that when transaction/2 +%% %% tries to commit it will fail +%% bdberl:txn_abort(), +%% %% Value to return +%% avalue +%% end, +%% %% This should fail as there is no transaction to commit +%% {error,{txn_commit,no_txn}} = bdberl:transaction(F). + update_should_save_value_if_successful(Config) -> Db = ?config(db, Config), ok = bdberl:put(Db, mykey, avalue),