anchor.diff:    ok = file:truncate(F),
     ok = file:close(F),
   
  -  ?assertThrow({truncate_failed, _}, stockdb_raw:open(File, [read])),
  +  {ok, S1} = stockdb_raw:open(File, [read]),
  +  ?assertThrow({truncate_failed, _}, stockdb_raw:restore_state(S1)),
   
     append_events_to_file(File, chunk_110_content_2() ++ chunk_112_content()),
   
  
positive.code:     end, S2, chunk_110_content_2() ++ chunk_112_content()),
    ok = stockdb_raw:close(S3),
  
    {ok, S4} = stockdb_raw:open(File, Options ++ [read]),
    ensure_states_equal(S3, S4),
    ok = stockdb_raw:close(S4),
  
  
negative.code:   ok = stockdb_raw:close(S1).
  
  ensure_states_equal(State1, State2) ->
    Elements = lists:seq(1, size(State1)) -- [3, 4, 5],
    lists:foreach(fun(N) ->
          % io:format("Comparing element ~w~n", [N]),
          ?assertEqual(element(N, State1), element(N, State2))
  