summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core/src/tests')
-rw-r--r--gnuradio-core/src/tests/Makefile.am6
-rw-r--r--gnuradio-core/src/tests/benchmark_dotprod_ccc.cc8
-rw-r--r--gnuradio-core/src/tests/benchmark_dotprod_ccf.cc8
-rw-r--r--gnuradio-core/src/tests/benchmark_vco.cc2
-rw-r--r--gnuradio-core/src/tests/test_all.cc7
-rw-r--r--gnuradio-core/src/tests/test_atsc.cc7
-rw-r--r--gnuradio-core/src/tests/test_filter.cc7
-rw-r--r--gnuradio-core/src/tests/test_general.cc7
-rw-r--r--gnuradio-core/src/tests/test_runtime.cc7
9 files changed, 24 insertions, 35 deletions
diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am
index 2bf7cb4e5..5879a13d8 100644
--- a/gnuradio-core/src/tests/Makefile.am
+++ b/gnuradio-core/src/tests/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2001,2008 Free Software Foundation, Inc.
+# Copyright 2001,2008,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -31,7 +31,7 @@ TESTS = test_all
# test_atsc
#Test program to test setting up buffers using gr_test which can be run manually
-EXTRA_DIST = \
+EXTRA_DIST += \
test_buffers.py \
benchmark_dotprod
@@ -59,7 +59,7 @@ noinst_SCRIPTS = \
benchmark_dotprod
-LIBGNURADIO = $(GNURADIO_CORE_LA)
+LIBGNURADIO = $(GNURADIO_CORE_LA) $(BOOST_FILESYSTEM_LIB)
LIBGNURADIOQA = $(top_builddir)/gnuradio-core/src/lib/libgnuradio-core-qa.la $(LIBGNURADIO)
benchmark_dotprod_fff_SOURCES = benchmark_dotprod_fff.cc
diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc
index 5d53a9f89..8ef26a40d 100644
--- a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc
+++ b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc
@@ -56,7 +56,8 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
{
int i;
gr_complex coeffs[NTAPS];
- gr_complex input[BLOCK_SIZE + NTAPS];
+ //gr_complex input[BLOCK_SIZE + NTAPS]; // not always 16-bit aligned
+ gr_complex *input = new gr_complex[BLOCK_SIZE + NTAPS];
long n;
gr_complex result;
#ifdef HAVE_SYS_RESOURCE_H
@@ -86,7 +87,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
exit (1);
}
#else
- clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC);
+ clock_start= (double) clock() / CLOCKS_PER_SEC;
#endif
// do the actual work
@@ -116,7 +117,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
double total = user + sys;
#else
- clock_end = (double) clock() * (1000000. / CLOCKS_PER_SEC);
+ clock_end = (double) clock() / CLOCKS_PER_SEC;
double total = clock_end - clock_start;
#endif
@@ -126,6 +127,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total);
delete f;
+ delete [] input;
}
static void
diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc
index 60855ec94..ed3c49165 100644
--- a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc
+++ b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc
@@ -56,7 +56,8 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
{
int i;
float coeffs[NTAPS];
- gr_complex input[BLOCK_SIZE + NTAPS];
+ //gr_complex input[BLOCK_SIZE + NTAPS]; // not always 16-bit aligned
+ gr_complex *input = new gr_complex[BLOCK_SIZE + NTAPS];
long n;
gr_complex result;
#ifdef HAVE_SYS_RESOURCE_H
@@ -86,7 +87,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
exit (1);
}
#else
- clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC);
+ clock_start= (double) clock() / CLOCKS_PER_SEC;
#endif
// do the actual work
@@ -118,7 +119,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
double total = user + sys;
#else
- clock_end= (double) clock() * (1000000. / CLOCKS_PER_SEC);
+ clock_end= (double) clock() / CLOCKS_PER_SEC;
double total = clock_end - clock_start;
#endif
@@ -128,6 +129,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total);
delete f;
+ delete [] input;
}
static void
diff --git a/gnuradio-core/src/tests/benchmark_vco.cc b/gnuradio-core/src/tests/benchmark_vco.cc
index ed0ae3b67..3a6ade78c 100644
--- a/gnuradio-core/src/tests/benchmark_vco.cc
+++ b/gnuradio-core/src/tests/benchmark_vco.cc
@@ -63,7 +63,7 @@ benchmark (void test (float *x, const float *y), const char *implementation_name
// touch memory
memset(output, 0, BLOCK_SIZE*sizeof(float));
for (int i = 0; i<BLOCK_SIZE; i++)
- input[i] = sin(i);
+ input[i] = sin(double(i));
// get starting CPU usage
#ifdef HAVE_SYS_RESOURCE_H
diff --git a/gnuradio-core/src/tests/test_all.cc b/gnuradio-core/src/tests/test_all.cc
index 17ee32f34..6cec8ad0e 100644
--- a/gnuradio-core/src/tests/test_all.cc
+++ b/gnuradio-core/src/tests/test_all.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002,2010 Free Software Foundation, Inc.
+ * Copyright 2002,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -34,11 +34,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gnuradio_core_all.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gnuradio_core_all.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_runtime::suite ());
diff --git a/gnuradio-core/src/tests/test_atsc.cc b/gnuradio-core/src/tests/test_atsc.cc
index 51642f81a..66cb2a312 100644
--- a/gnuradio-core/src/tests/test_atsc.cc
+++ b/gnuradio-core/src/tests/test_atsc.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,11 +29,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gnuradio_core_atsc.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gnuradio_core_atsc.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_atsc::suite ());
diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc
index 2781cfb35..3227a9ff2 100644
--- a/gnuradio-core/src/tests/test_filter.cc
+++ b/gnuradio-core/src/tests/test_filter.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002,2010 Free Software Foundation, Inc.
+ * Copyright 2002,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,11 +29,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gnuradio_core_filter.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gnuradio_core_filter.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_filter::suite ());
diff --git a/gnuradio-core/src/tests/test_general.cc b/gnuradio-core/src/tests/test_general.cc
index 16ee9c3ad..ca6dee40a 100644
--- a/gnuradio-core/src/tests/test_general.cc
+++ b/gnuradio-core/src/tests/test_general.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002,2010 Free Software Foundation, Inc.
+ * Copyright 2002,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,11 +29,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gnuradio_core_general.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gnuradio_core_general.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_general::suite ());
diff --git a/gnuradio-core/src/tests/test_runtime.cc b/gnuradio-core/src/tests/test_runtime.cc
index c7983a23e..77af3001b 100644
--- a/gnuradio-core/src/tests/test_runtime.cc
+++ b/gnuradio-core/src/tests/test_runtime.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002,2010 Free Software Foundation, Inc.
+ * Copyright 2002,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,11 +29,8 @@
int
main (int argc, char **argv)
{
- char path[200];
- get_unittest_path ("gnuradio_core_runtime.xml", path, 200);
-
CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(path);
+ std::ofstream xmlfile(get_unittest_path("gnuradio_core_runtime.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
runner.addTest (qa_runtime::suite ());