From f2d5299a3f7dd5baa795a27c2864b2cfe67edb37 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 14 Nov 2010 13:26:59 -0800 Subject: Add tests that show that vector> is not working... --- gnuradio-core/src/guile/tests/general_ctors.test | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gnuradio-core/src/guile') diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index 75c0f0bd4..a18766400 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -28,6 +28,28 @@ (use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) +(use-modules (ice-9 format)) + + +(define (verbose-equal? expected actual) + (cond ((equal? expected actual) #t) + (else + (format #t "Expected:\n~y\n" expected) + (format #t "Actual:\n~y\n" actual) + #f))) + + +;;; Test complex scalars +(pass-if (equal? 5.0+5.0i (gr:complex-scalar-test0))) +(pass-if (equal? 1.5+0.5i (gr:complex-scalar-test1 1+1i))) + +;;; Test complex vectors +(pass-if (verbose-equal? #(0+0i 1+1i 2+2i 3+3i 4+4i) + (gr:complex-vec-test0))) + +(pass-if (verbose-equal? #(1.5+0.5i 2.5+1.5i 3.5+2.5i) + (gr:complex-vec-test1 #(1+1i 2+2i 3+3i)))) + ;;; Add test code for all constructors in these files -- cgit