From 3870003b99d8d45c86a77f4cf25e477e2cc2ea04 Mon Sep 17 00:00:00 2001 From: mescalinum Date: Thu, 17 Nov 2011 20:17:38 +0000 Subject: add basic input test svn path=/trunk/externals/loaders/tclpd/; revision=15790 --- tests/Makefile | 12 +++++++----- tests/basic_input.pd | 21 +++++++++++++++++++++ tests/basic_input.ref | 4 ++++ tests/basic_input_helper.tcl | 24 ++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 tests/basic_input.pd create mode 100644 tests/basic_input.ref create mode 100644 tests/basic_input_helper.tcl diff --git a/tests/Makefile b/tests/Makefile index c9f94e8..6829119 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,9 +1,11 @@ all: - # check that test-system itself is functional - # TODO: check that this check is functional? :-D - sh runtest.sh helloworld - # basic output test - sh runtest.sh basic_output + @# check that test-system itself is functional + @# TODO: check that this check is functional? :-D + @sh runtest.sh helloworld + @# basic output test - outputting correct selector/atoms + @sh runtest.sh basic_output + @# basic input test - dispatching to correct methods + @sh runtest.sh basic_input clean: rm -fv *.out runtest-*.pd diff --git a/tests/basic_input.pd b/tests/basic_input.pd new file mode 100644 index 0000000..6623f3d --- /dev/null +++ b/tests/basic_input.pd @@ -0,0 +1,21 @@ +#N canvas 306 152 450 300 10; +#X obj 48 53 inlet; +#X obj 48 234 outlet; +#N canvas 0 0 450 300 bang_swap 0; +#X obj 63 58 inlet; +#X obj 63 112 t b b; +#X obj 112 172 outlet; +#X obj 63 172 outlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 3 0; +#X restore 48 89 pd bang_swap; +#X obj 117 115 outlet; +#X msg 48 144 123 \, symbol foo \, list 123 foo bar \, somethingelse +; +#X obj 48 187 basic_input_helper; +#X connect 0 0 2 0; +#X connect 2 0 4 0; +#X connect 2 1 3 0; +#X connect 4 0 5 0; +#X connect 5 0 1 0; diff --git a/tests/basic_input.ref b/tests/basic_input.ref new file mode 100644 index 0000000..5e15a9b --- /dev/null +++ b/tests/basic_input.ref @@ -0,0 +1,4 @@ +float; +symbol; +list; +anything; diff --git a/tests/basic_input_helper.tcl b/tests/basic_input_helper.tcl new file mode 100644 index 0000000..a5e3b52 --- /dev/null +++ b/tests/basic_input_helper.tcl @@ -0,0 +1,24 @@ +package require Tclpd 0.3.0 +package require TclpdLib 0.20 + +proc basic_input_helper::constructor {self args} { + pd::add_outlet $self list +} + +proc basic_input_helper::0_float {self args} { + pd::outlet $self 0 symbol float +} + +proc basic_input_helper::0_symbol {self args} { + pd::outlet $self 0 symbol symbol +} + +proc basic_input_helper::0_list {self args} { + pd::outlet $self 0 symbol list +} + +proc basic_input_helper::0_anything {self args} { + pd::outlet $self 0 symbol anything +} + +pd::class basic_input_helper -- cgit v1.2.1