Permalink
Browse files

tests: Reduce test space

  • Loading branch information...
1 parent 950c8e1 commit fc8976995f6a76a71c68c86889ddf9cb087a202e @psyeugenic committed Nov 25, 2012
Showing with 34 additions and 12 deletions.
  1. +1 −0 cover.spec
  2. +33 −12 test/egd_chart_SUITE.erl
View
@@ -0,0 +1 @@
+{incl_app, eplot, details}.
View
@@ -49,28 +49,25 @@ all() ->
[graph_api, graph_api_opts].
-make_simple_set(Min, Max, Step) ->
- [{X,30*math:sin(X)} || X <- lists:seq(Min,Max,Step)].
-
check_chart_result(B) when is_binary(B) -> ok.
graph_api(_Config) ->
- D1 = [{"graph 1", make_simple_set(0, 100, 1)}],
+ D1 = [{"graph 1", make_simple_set(0, 100, 12)}],
ok = check_chart_result(egd_chart:graph(D1)),
- D2 = [{"graph 2", make_simple_set(-100, 100, 1)}|D1],
+ D2 = [{"graph 2", make_simple_set(-100, 100, 13)}|D1],
ok = check_chart_result(egd_chart:graph(D2)),
- D3 = [{"graph 3", make_simple_set(-1000, 1000, 3)}|D2],
+ D3 = [{"graph 3", make_simple_set(-1000, 1000, 30)}|D2],
ok = check_chart_result(egd_chart:graph(D3)),
D4 = [{graph_4, make_simple_set(-1000, 1000, 3)}|D3],
ok = check_chart_result(egd_chart:graph(D4)),
- D5 = [{graph_5, make_simple_set(-1000, 10000, 1)}|D4],
+ D5 = [{graph_5, make_simple_set(-1000, 10000, 111)}|D4],
ok = check_chart_result(egd_chart:graph(D5)),
- D6 = [{graph_6, make_simple_set(-1000, 10000, 1)}],
+ D6 = [{graph_6, make_simple_set(-1000, 10000, 57)}],
ok = check_chart_result(egd_chart:graph(D6)),
D7 = [{"graph 7", make_simple_set(-300, -10, 1)}|D6],
@@ -81,7 +78,6 @@ graph_api(_Config) ->
check_graph_api_opts(_, []) -> ok;
check_graph_api_opts(Data, [Opts|Os]) ->
- io:format("~p - Data~n", [now()]),
ok = check_chart_result(egd_chart:graph(Data, Opts)),
check_graph_api_opts(Data, Os).
@@ -100,12 +96,37 @@ graph_api_opts(_Config) ->
Yrange <- [{0, 100}, {-1000, 1000}],
Ylabel <- ["Y-label"],
Xlabel <- ["X-label"],
- Rgba <- [{255,255,255}, {20,25,100,120}]
+ Rgba <- [{255,255,255}]
],
- D1 = [{"graph 1", make_simple_set(0, 1200, 60)}],
+ D1 = [{"graph 1", make_simple_set(0, 1200, 360)}],
ok = check_graph_api_opts(D1, Options),
- D2 = [{graph_2, make_simple_set(-30, -10, 3)}|D1],
+ D2 = [{graph_2, make_simple_set(-30, -10, 4)}|D1],
ok = check_graph_api_opts(D2, Options),
ok.
+
+%% aux
+
+make_simple_set(Min, Max, Step) ->
+ [{X,30*math:sin(X)} || X <- lists:seq(Min,Max,Step)].
+
+%functions() ->
+% [
+% fun(X) -> 500/(X * X) + X end,
+% fun(X) -> math:sqrt(X*X + 10*X) end,
+% fun(X) -> X*math:sin(X/200*6.28) end
+% ].
+%
+%
+%add_dataset(Fun, Min, Max, Step, Sets) ->
+% Name = "dataset " ++ integer_to_list(Min),
+% [{Name, [{X, Fun(X)} || X <- lists:seq(Min,Max,Step)]}|Sets].
+%
+%add_errorset(Fun, Min, Max, Step, Sets) ->
+% Name = "errorset " ++ integer_to_list(Min),
+% [{Name, [{X, Fun(X), rand(X)} || X <- lists:seq(Min,Max,Step)]}|Sets].
+%
+%
+%rand(N) -> random:uniform(N).
+

0 comments on commit fc89769

Please sign in to comment.