From 6237fafa53938db53a3e2a82b79e80b524dd05db Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 18 Nov 2010 22:22:23 -0800 Subject: gr_msg_queue now working correctly from within guile. --- gnuradio-core/src/guile/tests/00_runtime_ctors.test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gnuradio-core/src/guile') 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))))) -- cgit