diff --git a/csys/environ.lisp b/csys/environ.lisp index 5d00601..4c78d8d 100644 --- a/csys/environ.lisp +++ b/csys/environ.lisp @@ -38,7 +38,7 @@ (defun forward (msg scope) (dolist (cell (find-cells (cells scope) (message:addr msg))) (actor:send cell msg)) - msg) + nil) ;;;; helpers diff --git a/test/test-core.lisp b/test/test-core.lisp index bd9c946..648c502 100644 --- a/test/test-core.lisp +++ b/test/test-core.lisp @@ -37,6 +37,7 @@ (defun check-message (ctx msg) (let ((key (shape:head msg)) (t:*test-suite* (suite ctx))) + (util:lgi (expected ctx)) (multiple-value-bind (val found) (gethash key (expected ctx)) (if found (progn diff --git a/test/test-csys.lisp b/test/test-csys.lisp index 9932b95..7f55dcc 100644 --- a/test/test-csys.lisp +++ b/test/test-csys.lisp @@ -29,7 +29,8 @@ (defun setup-config () (config:add :test-receiver :setup #'tc:setup) - (config:add-action '(:csys :notify :c00 "0-0") (value-in '(1))) + ;(config:add-action '(:csys :notify :c00 "0-0") (value-in '(1))) + (config:add-action '(:csys :notify) #'tc:check-message) (config:add-action '(:csys) (constantly nil)) ) @@ -38,7 +39,8 @@ (util:mv-bind (nmsg (scope scope)) (csys:handle-action msg scope :actions (environ:actions)) (util:lgi nmsg (tc:receiver t:*test-suite*)) - (actor:send (core:mailbox (tc:receiver t:*test-suite*)) nmsg)))) + (when nmsg + (actor:send (core:mailbox (tc:receiver t:*test-suite*)) nmsg))))) (defun run () (let ((t:*test-suite* (make-instance 'tc:test-suite :name "csys"))) @@ -47,6 +49,7 @@ (unwind-protect (test-basic-0) (sleep 0.1) + (tc:check-expected) (t:show-result)))) ;;;; test: initialization @@ -62,8 +65,10 @@ env)) (deftest test-basic-0 () - (let ((env (setup-test (csys:make-program #'csys:eff-proc)))) + (let ((env (setup-test (csys:make-program #'csys:eff-proc))) + (rcvr (tc:receiver t:*test-suite*))) (sleep 0.1) + (tc:expect rcvr (message:create '(:csys :notify :c00 "0-0") :data '(:value 1))) (actor:send env (message:create '(:csys :value :c00 "0-0") :data '(:value 1))) (sleep 0.1) (core:shutdown)))