summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/guile
diff options
context:
space:
mode:
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