Permalink
Browse files

Added application all option no diff test, also trimmed dead code.

  • Loading branch information...
1 parent 76617a0 commit 09e571e61859fd1f94ef89713b3889ed73821c73 Gianfranco committed Jul 1, 2011
Showing with 4 additions and 27 deletions.
  1. +0 −9 src/frame_axiom.erl
  2. +4 −18 test/frame_axiom_tests.erl
View
@@ -176,21 +176,12 @@ diff(Ets,node) ->
{Connected,Disconnected} = split(connected,disconnected,Current,Recorded),
Connected++Disconnected.
-diff(Ets,application,Modes) when is_list(Modes) ->
- lists:foldl(fun(Mode,Acc) -> Acc++diff(Ets,application,Mode) end,[],Modes);
-
diff(Ets,application,start_stop) ->
Running = application:which_applications(),
[{application,Recorded,_}] = ets:lookup(Ets,application),
Started = [{started,hd(tuple_to_list(App))} ||App <- Running, not lists:member(App,Recorded)],
Stopped = [{stopped,hd(tuple_to_list(App))} ||App <- Recorded, not lists:member(App,Running)],
Started++Stopped;
-diff(Ets,application,load_unload) ->
- Loaded = application:loaded_applications(),
- [{application,_,Recorded}] = ets:lookup(Ets,application),
- NewLoaded = [{loaded,hd(tuple_to_list(App))} ||App <- Loaded, not lists:member(App,Recorded)],
- UnLoaded = [{unloaded,hd(tuple_to_list(App))} ||App <- Recorded, not lists:member(App,Loaded)],
- NewLoaded++UnLoaded;
diff(Ets,process,creation) ->
CurrentPids = erlang:processes(),
Key = {process,creation},
View
@@ -178,24 +178,10 @@ application_all_diff_test() ->
application:unload(snmp),
application:unload(inets).
-application_unload_and_stop_diff_test() ->
- application:load(inets),
- application:start(snmp),
- Ref = frame_axiom:snapshot(application),
- application:stop(snmp),
- application:unload(inets),
- ?assertEqual([{stopped,snmp},{unloaded,inets}],
- frame_axiom:diff(Ref,application,[start_stop,
- load_unload])),
- application:unload(snmp).
-
-application_no_change_diff_test() ->
- Ref = frame_axiom:snapshot(application),
- ?assertEqual([],frame_axiom:diff(Ref,application,start_stop)).
-
-application_load_no_change_diff_test() ->
- Ref = frame_axiom:snapshot(application),
- ?assertEqual([],frame_axiom:diff(Ref,application,load_unload)).
+application_all_no_diff_test() ->
+ Options = all,
+ Ref = frame_axiom:snapshot([{application,Options}]),
+ ?assertEqual([],frame_axiom:diff(Ref,[{application,Options}])).
%% ets
%% ---------------------------------------------------------

0 comments on commit 09e571e

Please sign in to comment.