The subdirectory "tests" now contains a growing set of unit tests for the libcoap API. To use this, you will need CUnit (see http://cunit.sourceforge.net) and must configure with the option --with-tests.