anchor.diff:  
   code_change(_, State, _) ->
       {ok, State}.
  +
   
   -ifdef(TEST).
   -include_lib("eunit/include/eunit.hrl").
  
positive.code:     {noreply, NewState};
  
  handle_info({chunk, {stored, Index, Offset, Length, Pid}}, State) ->
      #state{active=true, requests=Requests} = State,
      NewState = State#state{},
      {noreply, NewState}.
  
  terminate(_, State) ->
  
negative.code:     etorrent_utils:ping(pending()),
      etorrent_utils:ping(testpid()),
      %% Expect endgame to send out request if the chunk is dropped before it's stored
      ?assertEqual({ok, [{0, 0, 1}]}, ?chunkstate:request(1, testset(), testpid())),
      Orig ! die, etorrent_utils:wait(Orig).
  
  test_active_one_stored() ->
      ok = ?endgame:activate(testpid()),
      %% Spawn a separate process to introduce the chunk into endgame
      Orig = spawn_link(fun() ->
          ?pending:register(pending()),
          ?chunkstate:assigned(0, 0, 1, self(), testpid()),
          mainpid() ! assigned,
          etorrent_utils:expect(die)
      end),
      etorrent_utils:expect(assigned),
      %% Spawn a process that aquires the chunk from endgame and marks it as stored
      Pid = spawn_link(fun() ->
          ?pending:register(pending()),
          {ok, [{0,0,1}]} = ?chunkstate:request(1, testset(), testpid()),
          ?chunkstate:fetched(0, 0, 1, self(), testpid()),
          ?chunkstate:stored(0, 0, 1, self(), testpid()),
          mainpid() ! stored,
          etorrent_utils:expect(die)
      end),
      etorrent_utils:expect(stored),
      ?assertEqual({ok, assigned}, ?chunkstate:request(1, testset(), testpid())),
      Pid ! die, etorrent_utils:wait(Pid),
      etorrent_utils:ping(pending()),
      etorrent_utils:ping(testpid()),
      ?assertEqual({ok, assigned}, ?chunkstate:request(1, testset(), testpid())),
      Orig ! die, etorrent_utils:wait(Orig).
  
  
  
  
  