top of page

Task Arguments Test

This is a test program for task arguments.

Program



---

Task Arguments Test Program


---


prog_vars =

d/count 0

d/begin_count 255

d/message ""

prog_vars.


prog_start =

print "Prog Start"

/count 0

/message "Fred and Dag"

rdbg 7

lv

prog_start.


prog_loop =

inc /count

print "Run /count"

-- Channel input @TEST

-- print "Call Test Task2 Channel in"

-- test_task2 /240 "Jack and Jill"



-- Test task 1

print ""

print "Call Test Task1 no in or out"

test_task1


-- Test task 2

print ""

print "Call Test Task2 in only"

test_task2 123564 "Jack"


print "FRED_DAG"

test_task2 888 /message

lv

test_task5 123 123.456


print "Call Test Task2 in only RUN 2"

test_task2 88 "Jack and Jill"


print "Call Test Task2 in only RUN 3"

test_task2 /count "Jack and Jill"


-- System Varibale input

print "Call Math Task1 Sys var in"

maths_task1 /pi


-- Test task 3

print ""

print "Call Test Task3 out only"

d/out1 0

d/out2 ""

test_task3 -> /out1 /out2


print ""

print "Task3 out1 [ /out1 ] out2 [ /out2 ]"

print "Task3 direct o1 [ /output1 ] o2 [ /output2 ]"


-- Test task 4

print ""

print "Call Test Task4 in & out"

/out1 0

/out2 ""

test_task4 100 "Jack Penman" -> /out1 /out2


print "Task4 o1 [ /out1 ] o2 [ /out2 ]"

print "Task4 direct o1 [ /output41 ] o2 [ /output42 ]"



---

Deliberate Error Cases

The following are dekoverately wrong.



-- extra input arg.

maths_task1 /pi "Jack and Jill"


---


-- inc /count

-- any /count > 10 -> exitprog

exitprog

prog_loop.



test_task1 =

-- task with no inputs or outputs


print "test_task1 no in or out"


test_task1.



test_task2 /input1 1 /input2 "" =

-- task with inputs only.


print "test_task2 in1 /input1 in2 /input2"


test_task2.



test_task3 -> /output1 1 /output2 "" =

-- task with outputs only.


-- Set the output values.

/output1 100

/output2 "Output no 2"

print "test_task3 out1 [ /output1 ] out2 [ /output2 ]"


test_task3.




test_task4 /input41 1 /input42 "" -> /output41 1 /output42 "" =

-- task with inputs and outputs.


-- Set the output values.

/output41 100

/output42 "Output no 2"

print "test_task4 in1 [ /input41 ] in2 [ /input42 ]"

print "test_task4 out1 [ /output41 ] out2 [ /output42 ]"


test_task4.


test_task5 /in51 0 /in52 0.0 =

-- task with two numeric inputs.


print "Task5 Integer input [ /in51 ] float in [ /in52 ]"


test_task5.



maths_task1 /mathin1 0.0 =

print "Maths Task 1 input /mathin1"

maths_task1.


prog_stop =

print "bye"

prog_stop.



bottom of page