commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] gr-error-correcting-codes configure.ac src/lib/...


From: Michael Dickens
Subject: [Commit-gnuradio] gr-error-correcting-codes configure.ac src/lib/...
Date: Fri, 14 Jul 2006 19:49:26 +0000

CVSROOT:        /sources/gnuradio
Module name:    gr-error-correcting-codes
Changes by:     Michael Dickens <michaelld>     06/07/14 19:49:25

Modified files:
        .              : configure.ac 
        src/lib        : Makefile.am 
        src/lib/libecc : Makefile.am encoder.cc 
                         encoder_convolutional_ic1_ic1.h 
Added files:
        src/lib/libecc/tests: Makefile.am qa_ecc.cc qa_ecc.h 
                              qa_encoder_convolutional_ic1_ic1.cc 
                              qa_encoder_convolutional_ic1_ic1.h 
                              test_all.cc 
Removed files:
        src/lib/libecc : qa_ecc.cc qa_ecc.h 
                         qa_encoder_convolutional_ic1_ic1.cc 
                         qa_encoder_convolutional_ic1_ic1.h 

Log message:
        Moved QA to a 'tests' directory; updated Makefiles to work with that.
        Added some debugging comments.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/configure.ac?cvsroot=gnuradio&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/Makefile.am?cvsroot=gnuradio&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/Makefile.am?cvsroot=gnuradio&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/encoder.cc?cvsroot=gnuradio&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/encoder_convolutional_ic1_ic1.h?cvsroot=gnuradio&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/qa_ecc.cc?cvsroot=gnuradio&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/qa_ecc.h?cvsroot=gnuradio&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/qa_encoder_convolutional_ic1_ic1.cc?cvsroot=gnuradio&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/qa_encoder_convolutional_ic1_ic1.h?cvsroot=gnuradio&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/tests/Makefile.am?cvsroot=gnuradio&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/tests/qa_ecc.cc?cvsroot=gnuradio&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/tests/qa_ecc.h?cvsroot=gnuradio&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/tests/qa_encoder_convolutional_ic1_ic1.cc?cvsroot=gnuradio&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/tests/qa_encoder_convolutional_ic1_ic1.h?cvsroot=gnuradio&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/lib/libecc/tests/test_all.cc?cvsroot=gnuradio&rev=1.1

Patches:
Index: configure.ac
===================================================================
RCS file: /sources/gnuradio/gr-error-correcting-codes/configure.ac,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- configure.ac        3 Jul 2006 02:08:56 -0000       1.1
+++ configure.ac        14 Jul 2006 19:49:25 -0000      1.2
@@ -88,6 +88,14 @@
 GNURADIO_INCLUDES='-I$(GNURADIO_CORE_INCLUDEDIR) 
-I$(GNURADIO_CORE_INCLUDEDIR)/swig'
 AC_SUBST(GNURADIO_INCLUDES)
 
+dnl Define where to look for cppunit includes and libs
+dnl sets CPPUNIT_CFLAGS and CPPUNIT_LIBS
+AM_PATH_CPPUNIT([1.9.14],[],
+               [AC_MSG_ERROR([GNU Radio requires cppunit.  Stop])])
+
+CPPUNIT_INCLUDES=$CPPUNIT_CFLAGS
+AC_SUBST(CPPUNIT_INCLUDES)
+
 dnl Define where to find boost includes
 dnl defines BOOST_CFLAGS
 GR_REQUIRE_BOOST_INCLUDES
@@ -102,6 +110,7 @@
          src/lib/Makefile \
          src/lib/libecc/Makefile \
          src/lib/libecc/mld/Makefile \
+         src/lib/libecc/tests/Makefile \
          src/python/Makefile \
          src/python/run_tests \
        ])

Index: src/lib/Makefile.am
===================================================================
RCS file: /sources/gnuradio/gr-error-correcting-codes/src/lib/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- src/lib/Makefile.am 9 Jul 2006 16:15:17 -0000       1.3
+++ src/lib/Makefile.am 14 Jul 2006 19:49:25 -0000      1.4
@@ -81,9 +81,6 @@
        $(PYTHON_LDFLAGS)       \
        -lstdc++
 
-ecc.cc ecc.py: ecc.i $(ALL_IFILES)
-       $(SWIG) $(SWIGCPPPYTHONARGS) -module ecc -o ecc.cc $<
-
 # These headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS =                                    \
        gr_syms_to_metrics.h                            \
@@ -94,6 +91,9 @@
 # These swig headers get installed in ${prefix}/include/gnuradio/swig
 swiginclude_HEADERS = $(LOCAL_IFILES)
 
+ecc.cc ecc.py: ecc.i $(ALL_IFILES)
+       $(SWIG) $(SWIGCPPPYTHONARGS) -module ecc -o ecc.cc $<
+
 MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc *.loT *~
 
 CONFIG_CLEAN_FILES = *.in

Index: src/lib/libecc/Makefile.am
===================================================================
RCS file: 
/sources/gnuradio/gr-error-correcting-codes/src/lib/libecc/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- src/lib/libecc/Makefile.am  14 Jul 2006 17:29:25 -0000      1.7
+++ src/lib/libecc/Makefile.am  14 Jul 2006 19:49:25 -0000      1.8
@@ -21,11 +21,11 @@
 
 include $(top_srcdir)/Makefile.common
 
-SUBDIRS = mld .
+SUBDIRS = mld . tests
 
 INCLUDES = $(STD_DEFINES_AND_INCLUDES) -I..
 
-noinst_LTLIBRARIES = libecc.la libecc-qa.la
+noinst_LTLIBRARIES = libecc.la
 
 libecc_la_SOURCES =                            \
        encoder.cc code_metrics.cc              \
@@ -43,13 +43,7 @@
        encoder_turbo.h                         \
        decoder.h decoder_viterbi.h             \
        decoder_viterbi_full_block.h            \
-       decoder_viterbi_full_block_i1_ic1.h     \
-       qa_encoder_convolutional_ic1_ic1.h      \
-       qa_ecc.h
-
-libecc_qa_la_SOURCES =                                 \
-       qa_encoder_convolutional_ic1_ic1.cc     \
-       qa_ecc.cc
+       decoder_viterbi_full_block_i1_ic1.h
 
 # link the library against the c++ standard library
 libecc_la_LIBADD =             \

Index: src/lib/libecc/encoder.cc
===================================================================
RCS file: 
/sources/gnuradio/gr-error-correcting-codes/src/lib/libecc/encoder.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- src/lib/libecc/encoder.cc   9 Jul 2006 16:15:17 -0000       1.3
+++ src/lib/libecc/encoder.cc   14 Jul 2006 19:49:25 -0000      1.4
@@ -75,6 +75,10 @@
  char** out_buf,
  size_t n_bits_to_output)
 {
+  if (DO_PRINT_DEBUG) {
+    std::cout << "encode{out}(): Starting:";
+  }
+
   // set the class-internal number of input bits and
   // output bits left to encode
 
@@ -83,14 +87,21 @@
     compute_n_input_bits (n_bits_to_output);
   d_n_output_bits_left = n_bits_to_output;
 
+  if (DO_PRINT_DEBUG) {
+    std::cout <<
+      "# output bits provided = " << d_n_output_bits_left << "\n"
+      "# input bits computed  = " << d_n_input_bits_left << "\n";
+  }
+
   // call the private encode function
 
   encode_private (in_buf, out_buf);
 
   if (DO_PRINT_DEBUG) {
-    std::cout << "n_input_bits_used = " <<
-      (saved_n_input_bits - d_n_input_bits_left) << '\n';
-    std::cout << "n_output_bits_used = " <<
+    std::cout <<
+      "n_input_bits_used  = " <<
+      (saved_n_input_bits - d_n_input_bits_left) << "\n"
+      "n_output_bits_used = " <<
       (n_bits_to_output - d_n_output_bits_left) << '\n';
   }
 

Index: src/lib/libecc/encoder_convolutional_ic1_ic1.h
===================================================================
RCS file: 
/sources/gnuradio/gr-error-correcting-codes/src/lib/libecc/encoder_convolutional_ic1_ic1.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- src/lib/libecc/encoder_convolutional_ic1_ic1.h      12 Jul 2006 23:43:38 
-0000      1.4
+++ src/lib/libecc/encoder_convolutional_ic1_ic1.h      14 Jul 2006 19:49:25 
-0000      1.5
@@ -52,13 +52,16 @@
    bool do_termination = true,
    int start_memory_state = 0,
    int end_memory_state = 0)
+#if 1
     : encoder_convolutional (frame_size_bits,
                             n_code_inputs,
                             n_code_outputs,
                             code_generators,
                             do_termination,
                             start_memory_state,
-                            end_memory_state) {};
+                            end_memory_state)
+#endif
+  {};
 
   inline encoder_convolutional_ic1_ic1
   (int frame_size_bits,
@@ -69,6 +72,7 @@
    bool do_termination = true,
    int start_memory_state = 0,
    int end_memory_state = 0)
+#if 1
     : encoder_convolutional (frame_size_bits,
                             n_code_inputs,
                             n_code_outputs,
@@ -76,7 +80,9 @@
                             code_feedback,
                             do_termination,
                             start_memory_state,
-                            end_memory_state) {};
+                            end_memory_state)
+#endif
+{};
 
   virtual ~encoder_convolutional_ic1_ic1 () {};
 

Index: src/lib/libecc/tests/Makefile.am
===================================================================
RCS file: src/lib/libecc/tests/Makefile.am
diff -N src/lib/libecc/tests/Makefile.am
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/lib/libecc/tests/Makefile.am    14 Jul 2006 19:49:25 -0000      1.1
@@ -0,0 +1,47 @@
+#
+# Copyright 2001 Free Software Foundation, Inc.
+# 
+# This file is part of GNU Radio
+# 
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+# 
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+# 
+
+include $(top_srcdir)/Makefile.common
+
+INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) -I..
+
+noinst_LTLIBRARIES = libecc-qa.la
+
+noinst_HEADERS =                               \
+       qa_encoder_convolutional_ic1_ic1.h      \
+       qa_ecc.h
+
+libecc_qa_la_SOURCES =                                 \
+       qa_encoder_convolutional_ic1_ic1.cc     \
+       qa_ecc.cc
+
+# list of programs run by "make check" and "make distcheck"
+
+TESTS = test_all
+
+noinst_PROGRAMS = test_all
+
+LIBECC = ../libecc.la
+LIBECCQA = libecc-qa.la $(LIBECC)
+
+test_all_SOURCES = test_all.cc
+test_all_LDADD = $(LIBECCQA)           \
+       $(CPPUNIT_LIBS)

Index: src/lib/libecc/tests/qa_ecc.cc
===================================================================
RCS file: src/lib/libecc/tests/qa_ecc.cc
diff -N src/lib/libecc/tests/qa_ecc.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/lib/libecc/tests/qa_ecc.cc      14 Jul 2006 19:49:25 -0000      1.1
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2006 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * This class gathers together all the test cases for the gr
+ * directory into a single test suite.  As you create new test cases,
+ * add them here.
+ */
+
+#include <qa_ecc.h>
+#include <qa_encoder_convolutional_ic1_ic1.h>
+
+CppUnit::TestSuite*
+qa_ecc::suite
+()
+{
+  CppUnit::TestSuite* s = new CppUnit::TestSuite ("ecc");
+
+  s->addTest (qa_encoder_convolutional_ic1_ic1::suite ());
+  
+  return (s);
+}

Index: src/lib/libecc/tests/qa_ecc.h
===================================================================
RCS file: src/lib/libecc/tests/qa_ecc.h
diff -N src/lib/libecc/tests/qa_ecc.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/lib/libecc/tests/qa_ecc.h       14 Jul 2006 19:49:25 -0000      1.1
@@ -0,0 +1,36 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _QA_ECC_H_
+#define _QA_ECC_H_
+
+#include <cppunit/TestSuite.h>
+
+//! collect all the tests for the gr directory
+
+class qa_ecc {
+public:
+  //! return suite of tests for all of gr directory
+  static CppUnit::TestSuite *suite ();
+};
+
+#endif /* _QA_ECC_H_ */

Index: src/lib/libecc/tests/qa_encoder_convolutional_ic1_ic1.cc
===================================================================
RCS file: src/lib/libecc/tests/qa_encoder_convolutional_ic1_ic1.cc
diff -N src/lib/libecc/tests/qa_encoder_convolutional_ic1_ic1.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/lib/libecc/tests/qa_encoder_convolutional_ic1_ic1.cc    14 Jul 2006 
19:49:25 -0000      1.1
@@ -0,0 +1,158 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "encoder_convolutional_ic1_ic1.h"
+#include <qa_encoder_convolutional_ic1_ic1.h>
+#include <cppunit/TestAssert.h>
+#include <string.h>
+#include <iostream>
+#include <iomanip>
+#include <stdio.h>
+
+const static int t0_code_generator[6] = {1, 0, 5, 0, 1, 6};
+const static int t0_n_code_inputs = 3;
+const static int t0_n_code_outputs = 2;
+const static int t0_n_input_items = 10;
+const static int t0_n_output_items = 10;
+
+const static char t0_in_0[t0_n_input_items] =
+  {0, 1, 0, 0, 1, 0, 1, 0, 0, 0};
+const static char t0_in_1[t0_n_input_items] =
+  {0, 1, 0, 0, 0, 1, 1, 0, 0, 0};
+const static char t0_in_2[t0_n_input_items] =
+  {0, 0, 1, 1, 1, 1, 1, 0, 0, 0};
+const static char* t0_in[t0_n_code_inputs] =
+  {t0_in_0, t0_in_1, t0_in_2};
+
+const static char t0_res_0[t0_n_output_items] =
+  {0, 0, 1, 1, 1, 1, 1, 0, 0, 0};
+const static char t0_res_1[t0_n_output_items] =
+  {0, 0, 0, 1, 1, 1, 1, 1, 0, 0};
+const static char* t0_res[t0_n_code_outputs] =
+  {t0_res_0, t0_res_1};
+
+void
+qa_encoder_convolutional_ic1_ic1::t0
+()
+{
+  do_encoder_check ((const char**) t0_in, (const char**) t0_res,
+                   t0_n_output_items, 100, t0_n_code_inputs,
+                   t0_n_code_outputs, (const int*) t0_code_generator);
+}
+
+const static int t1_code_generator[6] = {1, 0, 0, 1, 5, 6};
+const static int t1_n_code_inputs = 2;
+const static int t1_n_code_outputs = 3;
+const static int t1_n_input_items = 9;
+const static int t1_n_output_items = 9;
+
+const static char t1_in_0[t1_n_input_items] =
+  {0, 1, 1, 1, 0, 0, 0, 1, 0};
+const static char t1_in_1[t1_n_input_items] =
+  {0, 0, 0, 0, 0, 1, 1, 1, 0};
+const static char* t1_in[t1_n_code_inputs] =
+  {t1_in_0, t1_in_1};
+
+const static char t1_res_0[t1_n_output_items] =
+  {0, 1, 1, 1, 0, 0, 0, 1, 0};
+const static char t1_res_1[t1_n_output_items] =
+  {0, 0, 0, 0, 0, 1, 1, 1, 0};
+const static char t1_res_2[t1_n_output_items] =
+  {0, 1, 1, 0, 1, 1, 1, 1, 0};
+const static char* t1_res[t1_n_code_outputs] =
+  {t1_res_0, t1_res_1, t1_res_2};
+
+void
+qa_encoder_convolutional_ic1_ic1::t1
+()
+{
+  do_encoder_check ((const char**) t1_in, (const char**) t1_res,
+                   t1_n_output_items, 100, t1_n_code_inputs,
+                   t1_n_code_outputs, (const int*) t1_code_generator);
+}
+
+void
+qa_encoder_convolutional_ic1_ic1::t2
+()
+{
+}
+
+void
+qa_encoder_convolutional_ic1_ic1::t3
+()
+{
+}
+
+void
+qa_encoder_convolutional_ic1_ic1::do_encoder_check
+(const char** c_in,
+ const char** c_res,
+ int n_output_items,
+ int block_size_bits,
+ int n_code_inputs,
+ int n_code_outputs,
+ const int* code_generators)
+{
+  std::cout << "Starting Encoder Check\n";
+
+  std::vector<int> t_code_generators;
+  t_code_generators.assign (n_code_inputs * n_code_outputs, 0);
+  for (int m = 0; m < n_code_inputs * n_code_outputs; m++)
+    t_code_generators[m] = code_generators[m];
+
+  std::cout << "Creating encoder.\n";
+
+  encoder_convolutional_ic1_ic1* t_encoder =
+    new encoder_convolutional_ic1_ic1 (block_size_bits,
+                                      n_code_inputs, 
+                                      n_code_outputs,
+                                      t_code_generators);
+
+  std::cout << "Created encoder @ " << t_encoder << "\n";
+
+  char** t_out = new char*[n_code_outputs];
+  for (int m = 0; m < n_code_outputs; m++) {
+    t_out[m] = new char[n_output_items];
+  }
+
+  std::cout << "Encoding test stream.\n";
+
+  t_encoder->encode (c_in, (char**) t_out, n_output_items);
+
+  std::cout << "Comparing results.\n";
+
+  for (int m = 0; m < n_code_outputs; m++) {
+    for (int n = 0; n < n_output_items; n++) {
+      CPPUNIT_ASSERT_EQUAL (c_res[m][n], t_out[m][n]);
+    }
+  }
+
+  delete t_encoder;
+  t_encoder = 0;
+
+  for (int m = 0; m < n_code_outputs; m++) {
+    delete [] t_out[m];
+    t_out[m] = 0;
+  }
+  delete [] t_out;
+  t_out = 0;
+}

Index: src/lib/libecc/tests/qa_encoder_convolutional_ic1_ic1.h
===================================================================
RCS file: src/lib/libecc/tests/qa_encoder_convolutional_ic1_ic1.h
diff -N src/lib/libecc/tests/qa_encoder_convolutional_ic1_ic1.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/lib/libecc/tests/qa_encoder_convolutional_ic1_ic1.h     14 Jul 2006 
19:49:25 -0000      1.1
@@ -0,0 +1,55 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef INCLUDED_QA_ENCODER_CONVOLUTIONAL_IC1_IC1_H
+#define INCLUDED_QA_ENCODER_CONVOLUTIONAL_IC1_IC1_H
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+#include <stdexcept>
+
+class qa_encoder_convolutional_ic1_ic1 : public CppUnit::TestCase {
+
+  CPPUNIT_TEST_SUITE (qa_encoder_convolutional_ic1_ic1);
+  CPPUNIT_TEST (t0);
+  CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
+  CPPUNIT_TEST_SUITE_END ();
+
+ private:
+  void do_encoder_check (const char** c_t1_in,
+                        const char** c_t1_res,
+                        int n_output_items,
+                        int block_size_bits,
+                        int n_code_inputs,
+                        int n_code_outputs,
+                        const int* code_generators);
+
+  void t0 ();
+  void t1 ();
+  void t2 ();
+  void t3 ();
+};
+
+
+#endif /* INCLUDED_QA_ENCODER_CONVOLUTIONAL_IC1_IC1_H */

Index: src/lib/libecc/tests/test_all.cc
===================================================================
RCS file: src/lib/libecc/tests/test_all.cc
diff -N src/lib/libecc/tests/test_all.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ src/lib/libecc/tests/test_all.cc    14 Jul 2006 19:49:25 -0000      1.1
@@ -0,0 +1,38 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <cppunit/TextTestRunner.h>
+#include <qa_ecc.h>
+
+int
+main
+(int argc,
+ char **argv)
+{
+  CppUnit::TextTestRunner runner;
+
+  runner.addTest (qa_ecc::suite ());
+
+  bool was_successful = runner.run ("", false);
+
+  return ((was_successful == true) ? 0 : 1);
+}

Index: src/lib/libecc/qa_ecc.cc
===================================================================
RCS file: src/lib/libecc/qa_ecc.cc
diff -N src/lib/libecc/qa_ecc.cc
--- src/lib/libecc/qa_ecc.cc    14 Jul 2006 17:29:25 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,40 +0,0 @@
-/*
- * Copyright 2006 Free Software Foundation, Inc.
- * 
- * This file is part of GNU Radio
- * 
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- * 
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * This class gathers together all the test cases for the gr
- * directory into a single test suite.  As you create new test cases,
- * add them here.
- */
-
-#include <qa_ecc.h>
-#include <qa_encoder_convolutional_ic1_ic1.h>
-
-CppUnit::TestSuite*
-qa_ecc::suite
-()
-{
-  CppUnit::TestSuite* s = new CppUnit::TestSuite ("ecc");
-
-  s->addTest (qa_encoder_convolutional_ic1_ic1::suite ());
-  
-  return (s);
-}

Index: src/lib/libecc/qa_ecc.h
===================================================================
RCS file: src/lib/libecc/qa_ecc.h
diff -N src/lib/libecc/qa_ecc.h
--- src/lib/libecc/qa_ecc.h     14 Jul 2006 17:29:25 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006 Free Software Foundation, Inc.
- * 
- * This file is part of GNU Radio
- * 
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- * 
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef _QA_ECC_H_
-#define _QA_ECC_H_
-
-#include <cppunit/TestSuite.h>
-
-//! collect all the tests for the gr directory
-
-class qa_ecc {
-public:
-  //! return suite of tests for all of gr directory
-  static CppUnit::TestSuite *suite ();
-};
-
-#endif /* _QA_ECC_H_ */

Index: src/lib/libecc/qa_encoder_convolutional_ic1_ic1.cc
===================================================================
RCS file: src/lib/libecc/qa_encoder_convolutional_ic1_ic1.cc
diff -N src/lib/libecc/qa_encoder_convolutional_ic1_ic1.cc
--- src/lib/libecc/qa_encoder_convolutional_ic1_ic1.cc  14 Jul 2006 17:29:25 
-0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,118 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006 Free Software Foundation, Inc.
- * 
- * This file is part of GNU Radio
- * 
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- * 
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "encoder_convolutional_ic1_ic1.h"
-#include <qa_encoder_convolutional_ic1_ic1.h>
-#include <cppunit/TestAssert.h>
-#include <string.h>
-#include <iostream>
-#include <iomanip>
-#include <stdio.h>
-
-const static int t1_code_generator[6] = {1, 0, 5, 0, 1, 6};
-
-const static char t1_in_0[10] =
-  {0, 1, 0, 0, 1, 0, 1, 0, 0, 0};
-const static char t1_in_1[10] =
-  {0, 1, 0, 0, 0, 1, 1, 0, 0, 0};
-const static char t1_in_2[10] =
-  {0, 0, 1, 1, 1, 1, 1, 0, 0, 0};
-const static char* t1_in[3] =
-  {t1_in_0, t1_in_1, t1_in_2};
-
-const static char t1_res_0[10] =
-  {0, 0, 1, 1, 1, 1, 1, 0, 0, 0};
-const static char t1_res_1[10] =
-  {0, 0, 0, 1, 1, 1, 1, 1, 0, 0};
-const static char* t1_res[2] =
-  {t1_res_0, t1_res_1};
-
-void
-qa_encoder_convolutional_ic1_ic1::t0
-()
-{
-  int n_code_inputs = 3;
-  int n_code_outputs = 2;
-  int n_output_items = 10;
-  
-  do_encoder_check ((const char**) t1_in, (const char**) t1_res,
-                   n_output_items, 100, n_code_inputs,
-                   n_code_outputs, (const int*) t1_code_generator);
-}
-
-void
-qa_encoder_convolutional_ic1_ic1::t1
-()
-{
-}
-
-void
-qa_encoder_convolutional_ic1_ic1::t2
-()
-{
-}
-
-void
-qa_encoder_convolutional_ic1_ic1::t3
-()
-{
-}
-
-void
-qa_encoder_convolutional_ic1_ic1::do_encoder_check
-(const char** c_t1_in,
- const char** c_t1_res,
- int n_output_items,
- int block_size_bits,
- int n_code_inputs,
- int n_code_outputs,
- const int* code_generators)
-{
-  std::vector<int> t_code_generators;
-  t_code_generators.assign (n_code_inputs * n_code_outputs, 0);
-  for (int m = 0; m < n_code_inputs * n_code_outputs; m++)
-    t_code_generators[m] = code_generators[m];
-
-  encoder_convolutional_ic1_ic1* t_encoder =
-    new encoder_convolutional_ic1_ic1 (block_size_bits,
-                                      n_code_inputs, 
-                                      n_code_outputs,
-                                      t_code_generators);
-
-  char** t1_out = new char*[3];
-  char* t1_out_0 = new char[n_output_items];
-  t1_out[0] = t1_out_0;
-  char* t1_out_1 = new char[n_output_items];
-  t1_out[1] = t1_out_1;
-  char* t1_out_2 = new char[n_output_items];
-  t1_out[2] = t1_out_2;
-  
-  t_encoder->encode (c_t1_in, n_output_items, (char**) t1_out);
-
-  for (int m = 0; m < n_code_outputs; m++) {
-    for (int n = 0; n < n_output_items; n++) {
-      CPPUNIT_ASSERT_EQUAL (c_t1_res[m][n], t1_out[m][n]);
-    }
-  }
-
-  delete t_encoder;
-}

Index: src/lib/libecc/qa_encoder_convolutional_ic1_ic1.h
===================================================================
RCS file: src/lib/libecc/qa_encoder_convolutional_ic1_ic1.h
diff -N src/lib/libecc/qa_encoder_convolutional_ic1_ic1.h
--- src/lib/libecc/qa_encoder_convolutional_ic1_ic1.h   14 Jul 2006 17:29:25 
-0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,55 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006 Free Software Foundation, Inc.
- * 
- * This file is part of GNU Radio
- * 
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- * 
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef INCLUDED_QA_ENCODER_CONVOLUTIONAL_IC1_IC1_H
-#define INCLUDED_QA_ENCODER_CONVOLUTIONAL_IC1_IC1_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/TestCase.h>
-#include <stdexcept>
-
-class qa_encoder_convolutional_ic1_ic1 : public CppUnit::TestCase {
-
-  CPPUNIT_TEST_SUITE (qa_encoder_convolutional_ic1_ic1);
-  CPPUNIT_TEST (t0);
-  CPPUNIT_TEST (t1);
-  CPPUNIT_TEST (t2);
-  CPPUNIT_TEST (t3);
-  CPPUNIT_TEST_SUITE_END ();
-
- private:
-  void do_encoder_check (const char** c_t1_in,
-                        const char** c_t1_res,
-                        int n_output_items,
-                        int block_size_bits,
-                        int n_code_inputs,
-                        int n_code_outputs,
-                        const int* code_generators);
-
-  void t0 ();
-  void t1 ();
-  void t2 ();
-  void t3 ();
-};
-
-
-#endif /* INCLUDED_QA_ENCODER_CONVOLUTIONAL_IC1_IC1_H */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]