re-enabled unittest building in Cmake & fixed C99 build issue
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 2 Mar 2017 04:31:39 +0000 (04:31 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 2 Mar 2017 04:31:39 +0000 (04:31 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3055 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/CMakeLists.txt
codec2-dev/unittest/test_cohpsk_ch.c

index 12b68b37e387d935d7368d629fd51dedc9fea278..940beb340569086a4762a6402fdfaaccd582aa69 100644 (file)
@@ -103,11 +103,11 @@ endif(MINGW)
 option(BUILD_SHARED_LIBS
     "Build shared library. Set to OFF for static library." ON)
 # Unittest should be on for dev builds and off for releases.
-#if(CMAKE_BUILD_TYPE MATCHES "Release")
+if(CMAKE_BUILD_TYPE MATCHES "Release")
     option(UNITTEST "Build unittest binaries." OFF)
-#else()
-    #option(UNITTEST "Build unittest binaries." ON)
-#endif()
+else()
+    option(UNITTEST "Build unittest binaries." ON)
+endif()
 option(INSTALL_EXAMPLES "Install example code." OFF)
 if(INSTALL_EXAMPLES)
     install(DIRECTORY octave raw script wav
index d81a6cf2d9406685355607ea2efc715c311603af..a3949729c043c87183fca4151d0d8303c748134b 100644 (file)
@@ -250,13 +250,13 @@ int main(int argc, char *argv[])
             memcpy(ch_buf, &ch_buf[nin_frame], sizeof(COMP)*ch_buf_n);
         nin_frame = tmp;
 
-       
-       for (int i = 0; i < COHPSK_BITS_PER_FRAME; i++)
+       int i;
+       for (i = 0; i < COHPSK_BITS_PER_FRAME; i++)
        {
            rx_bits_char[i] = rx_bits_sd[i];
        }
 
-        cohpsk_put_test_bits(coh, &state, error_pattern, &bit_errors, rx_bits_char);
+        cohpsk_put_test_bits(coh, &state, error_pattern, &bit_errors, rx_bits_char, 0);
         nerrors += bit_errors;
         nbits   += COHPSK_BITS_PER_FRAME;