anchor.diff:  
   reload_userdb() ->
       gen_server:cast(sipuserdb_file_backend, {reload_userdb}).
  +
  +
  +%%====================================================================
  +%% Test functions
  +%%====================================================================
  +
  +%%--------------------------------------------------------------------
  +%% Function: test()
  +%% Descrip.: autotest callback
  +%% Returns : ok | throw()
  +%%--------------------------------------------------------------------
  +test() ->
  +    io:format("test: init variables~n"),
  +
  +    Test_User1_Addresses = [test_make_address("test", "sip:a@example.org"),
  +			    test_make_address("test", "sip:b@example.org"),
  +			    test_make_address("test", "sip:1@example.org"),
  +			    test_make_address("test", "sip:11@example.org"),
  +			    test_make_address("test", "sip:both@example.org")
  +			   ],
  +
  +    Test_User2_Addresses = [test_make_address("test2", "sip:a2@example.org"),
  +			    test_make_address("test2", "sip:b2@example.org"),
  +			    test_make_address("test2", "sip:2@example.org"),
  +			    test_make_address("test2", "sip:22@example.org"),
  +			    test_make_address("test2", "sip:both@example.org")
  +			   ],
  +
  +    %% mix the two users addresses into a single list
  +    Test_Addresses_Zipped = lists:zip(Test_User1_Addresses, Test_User2_Addresses),
  +    Test_Addresses = lists:foldl(fun(T, Acc) when is_tuple(T) ->
  +					 L = tuple_to_list(T),
  +					 Acc ++ L
  +				 end, [], Test_Addresses_Zipped),
  +					 
  +
  +    %% get_addresses_using_user2(Username, Addresses, Res)
  +    %%--------------------------------------------------------------------
  +    io:format("test: get_addresses_using_user2/3 - 1~n"),
  +    %% test normal case, make sure order is preserved
  +    Test_User1_Addresses = get_addresses_using_user2("test", Test_Addresses, []),
  +
  +
  +    %% find_first_telephonenumber(In)
  +    %%--------------------------------------------------------------------
  +    io:format("test: find_first_telephonenumber/1 - 1~n"),
  +    %% test normal case
  +    #address{user = "test2", address = "sip:2@example.org"} =
  +	find_first_telephonenumber(Test_User2_Addresses),
  +
  +    io:format("test: find_first_telephonenumber/1 - 2~n"),
  +    nomatch = find_first_telephonenumber([]),
  +
  +    io:format("test: find_first_telephonenumber/1 - 3~n"),
  +    FFT_Addressses3 = [test_make_address("foo", "sip:alpha@example.org")],
  +    nomatch = find_first_telephonenumber(FFT_Addressses3),
  +
  +
  +    %% get_usernames_for_url(URL, Addresses, [])
  +    %%--------------------------------------------------------------------
  +    io:format("test: get_usernames_for_url/3 - 1~n"),
  +    ["test"] = get_usernames_for_url(sipurl:parse("sip:a@example.org"), Test_Addresses, []),
  +
  +    io:format("test: get_usernames_for_url/3 - 2~n"),
  +    ["test", "test2"] = get_usernames_for_url(sipurl:parse("sip:both@example.org"), Test_Addresses, []),
  +
  +
  +    %% collect_addresses(In)
  +    %%--------------------------------------------------------------------
  +    io:format("test: collect_addresses/1 - 1~n"),
  +    CollectAddresses_L1 = [test_make_address("foo", "sip:first@example.org"),
  +			   test_make_address("foo", "sip:second@example.org")],
  +    ["sip:first@example.org", "sip:second@example.org"] = collect_addresses(CollectAddresses_L1),
  +    
  +	
  +
  +    ok.
  +
  +test_make_address(U, A) ->
  +    #address{user    = U,
  +	     address = A,
  +	     url     = sipurl:parse(A)
  +	    }.
  +    
  
positive.code: 	    logger:log(debug, "userdb-file: No such user ~p when fetching telephone number", [Username]),
  	    nomatch;
  	User when is_record(User, user) ->
  	    case get_addresses_using_user(User) of
  		nomatch ->
  		    nomatch;
  		error ->
  
negative.code: 	 get_classes_for_user/1,
  	 get_telephonenumber_for_user/1,
  	 get_forwards_for_users/1,
  	 get_forward_for_user/1,
  
  	 test/0
  	]).
  
  %%--------------------------------------------------------------------
  