summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/guile
diff options
context:
space:
mode:
authorEric Blossom2010-11-14 13:26:59 -0800
committerEric Blossom2010-11-14 13:26:59 -0800
commitf2d5299a3f7dd5baa795a27c2864b2cfe67edb37 (patch)
tree9c9af83b87345610cab5b65b35c8ce9ce03921e7 /gnuradio-core/src/guile
parenteedcd7145c20403dcd0dcc44d15efb5d82beb7ec (diff)
downloadgnuradio-f2d5299a3f7dd5baa795a27c2864b2cfe67edb37.tar.gz
gnuradio-f2d5299a3f7dd5baa795a27c2864b2cfe67edb37.tar.bz2
gnuradio-f2d5299a3f7dd5baa795a27c2864b2cfe67edb37.zip
Add tests that show that vector<complex<float>> is not working...
Diffstat (limited to 'gnuradio-core/src/guile')
-rw-r--r--gnuradio-core/src/guile/tests/general_ctors.test22
1 files changed, 22 insertions, 0 deletions
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<float> 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<float> 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