summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
authorEric Blossom2010-11-29 10:59:10 -0800
committerEric Blossom2010-11-29 11:56:55 -0800
commit37c2a3826eb876e8942d83991cd94284cc886903 (patch)
tree2e8db63c9c867920681895191844badb3840c324 /gnuradio-core/src
parent8c37ad1bd2811623e803aafc566ad7029a5ce744 (diff)
downloadgnuradio-37c2a3826eb876e8942d83991cd94284cc886903.tar.gz
gnuradio-37c2a3826eb876e8942d83991cd94284cc886903.tar.bz2
gnuradio-37c2a3826eb876e8942d83991cd94284cc886903.zip
Add additional scripting language vector tests
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r--gnuradio-core/src/lib/general/complex_vec_test.cc45
-rw-r--r--gnuradio-core/src/lib/general/complex_vec_test.h16
-rw-r--r--gnuradio-core/src/lib/general/complex_vec_test.i17
3 files changed, 74 insertions, 4 deletions
diff --git a/gnuradio-core/src/lib/general/complex_vec_test.cc b/gnuradio-core/src/lib/general/complex_vec_test.cc
index 21bca1765..df25c325e 100644
--- a/gnuradio-core/src/lib/general/complex_vec_test.cc
+++ b/gnuradio-core/src/lib/general/complex_vec_test.cc
@@ -35,3 +35,48 @@ complex_scalar_test1(std::complex<float> input)
return std::complex<float>(input.real()+0.5, input.imag()-0.5);
}
+
+std::vector<float>
+float_vec_test0()
+{
+ std::vector<float> r(5);
+
+ for (size_t i = 0; i < r.size(); i++)
+ r[i] = (float) i;
+
+ return r;
+}
+
+std::vector<float>
+float_vec_test1(const std::vector<float> &input)
+{
+ std::vector<float> r(input.size());
+
+ for (size_t i = 0; i < input.size(); i++)
+ r[i] = input[i] + 0.5;
+
+ return r;
+}
+
+std::vector<int>
+int_vec_test0()
+{
+ std::vector<int> r(5);
+
+ for (size_t i = 0; i < r.size(); i++)
+ r[i] = (int) i;
+
+ return r;
+}
+
+std::vector<int>
+int_vec_test1(const std::vector<int> &input)
+{
+ std::vector<int> r(input.size());
+
+ for (size_t i = 0; i < input.size(); i++)
+ r[i] = input[i] + 1;
+
+ return r;
+}
+
diff --git a/gnuradio-core/src/lib/general/complex_vec_test.h b/gnuradio-core/src/lib/general/complex_vec_test.h
index f1a8a14e2..d13dedf63 100644
--- a/gnuradio-core/src/lib/general/complex_vec_test.h
+++ b/gnuradio-core/src/lib/general/complex_vec_test.h
@@ -1,10 +1,10 @@
#include <vector>
#include <complex>
-std::vector<std::complex<float> >
+std::vector<std::complex<float> >
complex_vec_test0();
-std::vector<std::complex<float> >
+std::vector<std::complex<float> >
complex_vec_test1(const std::vector<std::complex<float> > &input);
std::complex<float>
@@ -13,3 +13,15 @@ complex_scalar_test0();
std::complex<float>
complex_scalar_test1(std::complex<float> input);
+std::vector<int>
+int_vec_test0();
+
+std::vector<int>
+int_vec_test1(const std::vector<int> &input);
+
+std::vector<float>
+float_vec_test0();
+
+std::vector<float>
+float_vec_test1(const std::vector<float> &input);
+
diff --git a/gnuradio-core/src/lib/general/complex_vec_test.i b/gnuradio-core/src/lib/general/complex_vec_test.i
index 1c62cfda2..4b95633be 100644
--- a/gnuradio-core/src/lib/general/complex_vec_test.i
+++ b/gnuradio-core/src/lib/general/complex_vec_test.i
@@ -1,7 +1,8 @@
-std::vector<std::complex<float> >
+
+std::vector<std::complex<float> >
complex_vec_test0();
-std::vector<std::complex<float> >
+std::vector<std::complex<float> >
complex_vec_test1(const std::vector<std::complex<float> > &input);
std::complex<float>
@@ -10,3 +11,15 @@ complex_scalar_test0();
std::complex<float>
complex_scalar_test1(std::complex<float> input);
+std::vector<int>
+int_vec_test0();
+
+std::vector<int>
+int_vec_test1(const std::vector<int> &input);
+
+std::vector<float>
+float_vec_test0();
+
+std::vector<float>
+float_vec_test1(const std::vector<float> &input);
+