From 74d7b1b942c6f1d984e263f6675a9423197a3215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 19 Jan 2010 11:34:56 +0000 Subject: Add test suite for the tools application --- .../test/cprof_SUITE_data/cprof_SUITE_test.erl | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/tools/test/cprof_SUITE_data/cprof_SUITE_test.erl (limited to 'lib/tools/test/cprof_SUITE_data') diff --git a/lib/tools/test/cprof_SUITE_data/cprof_SUITE_test.erl b/lib/tools/test/cprof_SUITE_data/cprof_SUITE_test.erl new file mode 100644 index 0000000000..02d8b027e5 --- /dev/null +++ b/lib/tools/test/cprof_SUITE_data/cprof_SUITE_test.erl @@ -0,0 +1,25 @@ +-module(cprof_SUITE_test). + +-export([seq/3, seq_r/3]). + + + +%% Stack recursive seq +seq(Stop, Stop, Succ) when function(Succ) -> + [Stop]; +seq(Start, Stop, Succ) when function(Succ) -> + [Start | seq(Succ(Start), Stop, Succ)]. + + + +%% Tail recursive seq, result list is reversed +seq_r(Start, Stop, Succ) when function(Succ) -> + seq_r(Start, Stop, Succ, []). + +seq_r(Stop, Stop, _, R) -> + [Stop | R]; +seq_r(Start, Stop, Succ, R) -> + seq_r(Succ(Start), Stop, Succ, [Start | R]). + + + -- cgit v1.2.3