Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: picocoap/tests/coap_test.c
- Revision:
- 26:3d46024a8c30
- Parent:
- 7:f9df43829cea
--- a/picocoap/tests/coap_test.c Tue Jan 06 13:02:02 2015 -0600
+++ b/picocoap/tests/coap_test.c Wed Jan 07 12:37:30 2015 -0600
@@ -161,6 +161,22 @@
mu_assert("[ERROR] GET CON option two value was wrong.",
memcmp(option.val, ref_bin+14, option.len) == 0);
+ option = coap_get_option_by_num(&msg_ref, CON_URI_QUERY, 0);
+ mu_assert("[ERROR] GET CON option by num length was wrong.",
+ option.len == 40);
+ mu_assert("[ERROR] GET CON option by num number was wrong.",
+ option.num == CON_URI_QUERY);
+ mu_assert("[ERROR] GET CON option by num value was wrong.",
+ memcmp(option.val, ref_bin+14, option.len) == 0);
+
+ option = coap_get_option_by_num(&msg_ref, CON_ETAG, 0);
+ mu_assert("[ERROR] GET CON non-option by num length not zero.",
+ option.len == 0);
+ mu_assert("[ERROR] GET CON non-option by num number not null.",
+ option.num == 0);
+ mu_assert("[ERROR] GET CON non-option by num value not null.",
+ option.val == NULL);
+
return 0;
}