From: drowe67 Date: Thu, 2 Mar 2017 04:31:39 +0000 (+0000) Subject: re-enabled unittest building in Cmake & fixed C99 build issue X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=b494c43c6a34091189cdee87b5209d147d1e123c;p=freetel-svn-tracking.git re-enabled unittest building in Cmake & fixed C99 build issue git-svn-id: https://svn.code.sf.net/p/freetel/code@3055 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/CMakeLists.txt b/codec2-dev/CMakeLists.txt index 12b68b37..940beb34 100644 --- a/codec2-dev/CMakeLists.txt +++ b/codec2-dev/CMakeLists.txt @@ -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 diff --git a/codec2-dev/unittest/test_cohpsk_ch.c b/codec2-dev/unittest/test_cohpsk_ch.c index d81a6cf2..a3949729 100644 --- a/codec2-dev/unittest/test_cohpsk_ch.c +++ b/codec2-dev/unittest/test_cohpsk_ch.c @@ -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;