significant upgrade to selftest, added echotest, better checks for data in queue before socket closure

This commit is contained in:
Joseph Henry
2017-06-16 16:58:30 -07:00
parent 4403f902a4
commit 195cac6d55
17 changed files with 1038 additions and 658 deletions

View File

@@ -1996,7 +1996,7 @@ int pico_transport_process_in(struct pico_protocol *self, struct pico_frame *f)
return ret;
if (!IS_BCAST(f)) {
dbg("Socket not found... \n");
DEBUG_EXTRA("Socket not found...");
pico_notify_socket_unreachable(f);
ret = -1;
pico_err = PICO_ERR_ENOENT;

View File

@@ -33,6 +33,8 @@
#include "pico_socket.h"
#include "heap.h"
#include "../../../include/Debug.hpp"
/* Mockables */
#if defined UNIT_TEST
# define MOCKABLE __attribute__((weak))
@@ -831,13 +833,13 @@ pico_timer_ref_add(pico_time expire, struct pico_timer *t, uint32_t id, uint32_t
tref.hash = hash;
if (heap_insert(Timers, &tref) < 0) {
dbg("Error: failed to insert timer(ID %u) into heap\n", id);
DEBUG_ERROR("Error: failed to insert timer(ID %u) into heap", id);
PICO_FREE(t);
pico_err = PICO_ERR_ENOMEM;
return 0;
}
if (Timers->n > PICO_MAX_TIMERS) {
dbg("Warning: I have %d timers\n", (int)Timers->n);
DEBUG_ERROR("Warning: I have %d timers", (int)Timers->n);
}
return tref.id;