Commit Graph
5 Commits
Author SHA1 Message Date
Jon Shallow e6661fbdfc Support FreeBSD 11.2 builds
src/coap_io.c:
ifdef out IPv4 struct in_pktinfo code that does not compile, copying what
has been done later in the same coap_network_send() function.

tests/test_session.c
Correctly reverse the parameters to coap_new_client_session() in t_session6()
so that the test application does not bind to local-address, port 5683 twice.
[It seems that other distrubutions are happy with this when just SO_REUSEADDR
is used on the socket, but FreeBSD needs SO_REUSEPORT enabled as well.]

BUILDING
Record that gmake is required to build TinyDTLS for FreeBSD, not make.
2018-12-10 20:15:25 +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
Olaf Bergmann 56caa06677 test_session.c: fix warning for taken absolute value of unsigned int
This change replaces the call of abs(v - ref) to avoid a compiler
warning for -Wabsolute-value:

test_session.c:95:11: warning: taking the absolute value of unsigned type 'unsigned int' has no effect
      [-Wabsolute-value]
  return (abs(v - ref) / 100.0) <= FP_ERR_THRESHOLD;
2018-05-28 13:26:10 +02: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 8f9ca22e05 tests: add unit tests for session handling
This change adds an initial set of unit tests for sessions:

* reference counting and release
* timeout calculation
2018-03-06 16:45:28 +01:00