Commit Graph
10 Commits
Author SHA1 Message Date
Jon Shallow 91737ccb46 versioning: Include api version in non-posix coap_config.h/coap.h .in files
Add in some new .in files, but still keep original files in distribution
files.

Essentially, use coap@LIBCOAP_API_VERSION@ (or equivalent) instead of
coap2. so resultant files have the correct value.

coap_config.h.lwip.in: (new)
coap_config.h.riot.in: (new)
include/coap2/coap.h.windows.in: (new)

As per https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html, many of the
coap2/ prefixes are not required for #include, so these have been removed.

Make sure that the test suite accesses the latest source version of
coap@LIBCOAP_API_VERSION@/coap.h by creating a tests/test_common.h.in that
makes the correct tests/test_common.h which is included in all of the test
suite files.
2021-04-07 13:01:42 +01:00
Jon Shallow 0c031d7904 include: Move header files into libcoap namespace
I.E. '#include "mem.h"' becomes '#include "coap2/mem.h"'

This prevents header name clashes.

Replacement for #487
2021-03-08 16:45:02 +00:00
Jon Shallow f5367ef3de Delete trailing spaces from files, replace TAB with 8*SPACE
"git diff -w" shows no differences

TAB left alone in files that are not C based files or documentation
2018-09-28 17:34:07 +01:00
Jon Shallow 7dc16ed184 tests/*.c, examples/*.c: Remove cast-qual compiler warnings
Created new 'CU_ASSERT_PTR_EQUAL_C(actual, expected)' to handle const variable matching

Where appropriate

Replace 'unsigned char' with 'const uint8_t'
Replace 'str' with 'coap_str_c_t'
Replace 'str' with 'coap_string_t'
Prefix with 'const' some type casts
Update coap_add_attr() calls inline with updated API
Update coap_resource_init() calls inline with updated API
Make use of coap_make_str_const() for defining parameters

tests*/.c
Update code to stop memory leaks (as found by valgrind)

examples/coap-rd.c
Track the fact that uri_path in coap_resource_t is now a pointer
2018-05-25 14:11:04 +01:00
Olaf Bergmann 67291e397b tests: revert commit a3da53d to re-enable IPv6 in unit tests 2018-02-15 20:05:01 +01:00
Olaf Bergmann a3da53d5e3 tests: use IPv4 in unit tests for robustness
As unit tests with IPv6 addresses keep failing on docker-based
travis CI, this changes reverts to IPv4 usage in following files:

    test_wellknown.c
    test_sendqueue.c
2018-02-14 16:06:52 +01:00
Olaf Bergmann 4c38c6a7b2 test_{sendqueue,wellknown}.c: use new session-specific API
Sendqueue nodes and send operations now require a session object.
This modification calls coap_new_client_session() on a global
coap_context_t object to create a fake session on the loopback
interface.
2017-07-10 14:21:36 +02:00
Carsten Schoenert 63924379e3 testdriver: switch linking to the shared library
The testdriver was linked against the statically generated library of
libcoap. By this the testdriver will *always* find any symbols, no
matter if it is a private or public symbol.
Due this the testing behavior isn't the same as a user would use the
shared library and can get a potentially pitfall even if the testdriver
was successful.

Due previous changes to the public header the testdriver source needs
now the local header coap_config.h to find all needed functions so there
are small changes needed to the source files.
2015-07-04 19:35:10 +02:00
Olaf Bergmann fa3f09cdb7 Fix warnings in unit tests 2015-03-04 15:10:09 +01:00
Olaf Bergmann a4358bd2ce added tests for relative timestamps 2014-02-05 14:53:58 +01:00