This directory contains test code for libcw library.




The tests in this directory can be considered as unit tests, but this
may not be a 100% accurate description of the tests.




There are two main types of test functions:

A. test functions testing existing public API from libcw.h. The API is
called "legacy API" because in the future I would like to replace it
with something better. This set also includes a single function that
verifies that a fix of one specific bug, implemented some time ago, is
still working.

B. test functions testing new (future) public API and internal
functions of libcw that are used to implement both legacy API and new
API. The future public API is not official yet, it's not stable nor
fully specified.




There is a main program that calls these test functions. The test
program uses a tiny custom test framework to execute test functions
described in points A and B. The tests are separated into topics
(e.g. generator, tone queue, receiver, etc). Big part of the test
functions is executed few times: once per every supported and
available sound system (e.g. OSS, ALSA, PulseAudio). Testing the code
with different sound systems is necessary because behaviour of some
low level functions may depend on how a sound system handles received
PCM frames.




--------




In addition to the unit tests, the following Quality Assurance
measures are implemented:

1. TO BE DONE: test coverage reports (gcov),

2. IN PROGRESS: static code analysis with cppcheck, done with top-level
   qa/lint_cppcheck.sh script

3. IN PROGRESS: static code analysis with clang-tidy, done with top-level
   qa/lint_clang_tidy.sh using a top-level .clang-tidy config file (the list
   of enabled checks is for now rather small)

4. TO BE DONE: compilation with c++ compilers (g++ and clang) (for
   both production code and test code),

5. TO BE DONE: compilation with -Wall -Werror -pedantic -Wextra
   (other) by default (for both production code and test code),

6. TO BE DESCRIBED: valgrind,

7. PARTIALLY DONE, TO BE DESCRIBED: compilation and tests on different
   platforms.

