anchor.diff:  -vsn('$Id$').
   
   all() ->
  -    [test_copy_value_to_snapshot_table,test_set_get_for_snapshot_table,
  -     test_delete_from_snapshot_table,test_init_snapshot,test_delete_snapshot,
  +    [test_copy_value_to_snapshot_table, test_set_get_for_snapshot_table,
  +     test_delete_from_snapshot_table, test_init_snapshot, test_delete_snapshot,
        %% rdht_tx_read
  -     test_rdht_tx_read_validate_should_abort,test_rdht_tx_read_validate_should_prepare,
  -     test_rdht_tx_read_validate_db_copy,test_rdht_tx_read_commit_with_snap_1,
  +     test_rdht_tx_read_validate_should_abort, test_rdht_tx_read_validate_should_prepare,
  +     test_rdht_tx_read_validate_db_copy, test_rdht_tx_read_commit_with_snap_1,
        test_rdht_tx_read_commit_with_snap_2, test_rdht_tx_read_commit_without_snap,
        %% rdht_tx_write
  -     test_rdht_tx_write_validate_should_abort,test_rdht_tx_write_validate_should_prepare,
  -     test_rdht_tx_write_validate_db_copy,test_rdht_tx_write_commit_with_snap,
  +     test_rdht_tx_write_validate_should_abort, test_rdht_tx_write_validate_should_prepare,
  +     test_rdht_tx_write_validate_db_copy, test_rdht_tx_write_commit_with_snap,
        test_rdht_tx_write_commit_without_snap, test_rdht_tx_write_abort_without_snap,
        test_rdht_tx_write_abort_with_snap,
        %% lock counting
  
positive.code:     
      % get a final snapshot and print it
      Snap = api_tx:get_system_snapshot(),
      ?equals_pattern(Snap,[{_,_,_},{_,_,_}]),
      ct:pal("snapshot: ~p~n",[Snap]),
      ok.
  
  -spec do_transaction_a(number()) -> any().
  do_transaction_a(_I) ->
      %% ct:pal("spaming transaction_a...~p",[I]),
      api_tx:req_list([{read,"B"},{write,"A",randoms:getRandomInt()},{write,"B",randoms:getRandomInt()},{commit}]).
  
  -spec do_transaction_b(number()) -> any().
  do_transaction_b(_I) ->
      %% ct:pal("spaming transaction_b...~p",[I]),
      api_tx:req_list([{read,"A"},{write,"B",randoms:getRandomInt()},{write,"A",randoms:getRandomInt()},{commit}]).
  
  -spec bench_increment(any()) -> ok.
  bench_increment(_) ->
  
negative.code: -spec test_rdht_tx_read_validate_db_copy(any()) -> ok.
  test_rdht_tx_read_validate_db_copy(_) ->
      Db = ?TEST_DB:init_snapshot(?TEST_DB:new()),
      Db = ?TEST_DB:set_entry(Db, db_entry:new("key", "val", 1)),
      TLogEntry = tx_tlog:new_entry(rdht_tx_read, "key", 2, value, 1, ?value, "new_val"),
      {NewDb, _Vote} = rdht_tx_read:validate(Db, 1, TLogEntry),
      SnapEntry = ?TEST_DB:get_snapshot_entry(NewDb, "key"),
      ?equals({true, {"key", "val", false, 0, 1}}, SnapEntry), % no readlocks in snap db
      LiveEntry = ?TEST_DB:get_entry2(NewDb, "key"),
      ?equals({true, {"key", "val", false, 1, 1}}, LiveEntry), % 1 readlock in live db
      ok.
  
  % for "old" transactions (as in TM snapnr 1 is lesser than local snapnr 2) , changes
  