anchor.diff:      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())).
  +    ?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).
  +
   
   
   
  
positive.code:     ?_test(test_activated()),
      ?_test(test_active_one_assigned()),
      ?_test(test_active_one_dropped()),
      ?_test(test_active_one_fetched())
      ]}}.
  
  test_registers() ->
  
negative.code: 
  code_change(_, State, _) ->
      {ok, State}.
  
  
  -ifdef(TEST).
  -include_lib("eunit/include/eunit.hrl").
  