diff options
author | Eric Blossom | 2010-11-18 22:22:23 -0800 |
---|---|---|
committer | Eric Blossom | 2010-11-18 23:02:55 -0800 |
commit | 6237fafa53938db53a3e2a82b79e80b524dd05db (patch) | |
tree | aa95a9db143c5454ed3b22c87fbc1dcc29797947 /gnuradio-core/src/guile | |
parent | d1d226abdede58231583369047861cd2216489e9 (diff) | |
download | gnuradio-6237fafa53938db53a3e2a82b79e80b524dd05db.tar.gz gnuradio-6237fafa53938db53a3e2a82b79e80b524dd05db.tar.bz2 gnuradio-6237fafa53938db53a3e2a82b79e80b524dd05db.zip |
gr_msg_queue now working correctly from within guile.
Diffstat (limited to 'gnuradio-core/src/guile')
-rw-r--r-- | gnuradio-core/src/guile/tests/00_runtime_ctors.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gnuradio-core/src/guile/tests/00_runtime_ctors.test b/gnuradio-core/src/guile/tests/00_runtime_ctors.test index 0c131f5bd..966d8c909 100644 --- a/gnuradio-core/src/guile/tests/00_runtime_ctors.test +++ b/gnuradio-core/src/guile/tests/00_runtime_ctors.test @@ -32,4 +32,23 @@ ;;; Add test code for all constructors in these files ;;; ;;; ./runtime/gr_hier_block2.h + ;;; ./runtime/gr_msg_queue.h + +(define (equal-message? a b) + (equal? (gr:to-string a) (gr:to-string b))) + +(with-test-prefix "gr:message/gr:msg-queue" + (let ((msg1 (gr:message-from-string "Hello")) + (msg2 (gr:message-from-string "World!")) + (q (gr:msg-queue))) + (pass-if (equal? "Hello" (gr:to-string msg1))) + (pass-if (equal? "World!" (gr:to-string msg2))) + (pass-if (gr:empty-p q)) + (gr:insert-tail q msg1) + (pass-if (not (gr:empty-p q))) + (gr:insert-tail q msg2) + (let ((r1 (gr:delete-head q)) + (r2 (gr:delete-head q))) + (pass-if (equal-message? r1 msg1)) + (pass-if (equal-message? r2 msg2))))) |