From 37c2a3826eb876e8942d83991cd94284cc886903 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 29 Nov 2010 10:59:10 -0800 Subject: Add additional scripting language vector tests --- gnuradio-core/src/lib/general/complex_vec_test.cc | 45 +++++++++++++++++++++++ gnuradio-core/src/lib/general/complex_vec_test.h | 16 +++++++- gnuradio-core/src/lib/general/complex_vec_test.i | 17 ++++++++- 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 input) return std::complex(input.real()+0.5, input.imag()-0.5); } + +std::vector +float_vec_test0() +{ + std::vector r(5); + + for (size_t i = 0; i < r.size(); i++) + r[i] = (float) i; + + return r; +} + +std::vector +float_vec_test1(const std::vector &input) +{ + std::vector r(input.size()); + + for (size_t i = 0; i < input.size(); i++) + r[i] = input[i] + 0.5; + + return r; +} + +std::vector +int_vec_test0() +{ + std::vector r(5); + + for (size_t i = 0; i < r.size(); i++) + r[i] = (int) i; + + return r; +} + +std::vector +int_vec_test1(const std::vector &input) +{ + std::vector 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 #include -std::vector > +std::vector > complex_vec_test0(); -std::vector > +std::vector > complex_vec_test1(const std::vector > &input); std::complex @@ -13,3 +13,15 @@ complex_scalar_test0(); std::complex complex_scalar_test1(std::complex input); +std::vector +int_vec_test0(); + +std::vector +int_vec_test1(const std::vector &input); + +std::vector +float_vec_test0(); + +std::vector +float_vec_test1(const std::vector &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::vector > complex_vec_test0(); -std::vector > +std::vector > complex_vec_test1(const std::vector > &input); std::complex @@ -10,3 +11,15 @@ complex_scalar_test0(); std::complex complex_scalar_test1(std::complex input); +std::vector +int_vec_test0(); + +std::vector +int_vec_test1(const std::vector &input); + +std::vector +float_vec_test0(); + +std::vector +float_vec_test1(const std::vector &input); + -- cgit