From 0d0a36906c042bae3b5827c177411d9c9182440c Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 16 Nov 2021 22:14:19 +0000 Subject: [PATCH] Add missing stubs. --- test/unit/persist_read_stubs.c | 8 ++++++++ test/unit/persist_write_stubs.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/test/unit/persist_read_stubs.c b/test/unit/persist_read_stubs.c index 31724b89..2d088ac7 100644 --- a/test/unit/persist_read_stubs.c +++ b/test/unit/persist_read_stubs.c @@ -197,3 +197,11 @@ void db__msg_add_to_queued_stats(struct mosquitto_msg_data *msg_data, struct mos UNUSED(msg_data); UNUSED(msg); } + +void context__add_to_by_id(struct mosquitto *context) +{ + if(context->in_by_id == false){ + context->in_by_id = true; + HASH_ADD_KEYPTR(hh_id, db.contexts_by_id, context->id, strlen(context->id), context); + } +} diff --git a/test/unit/persist_write_stubs.c b/test/unit/persist_write_stubs.c index 173cd4ea..5cc4a597 100644 --- a/test/unit/persist_write_stubs.c +++ b/test/unit/persist_write_stubs.c @@ -113,3 +113,11 @@ int send__pubrel(struct mosquitto *mosq, uint16_t mid, const mosquitto_property return MOSQ_ERR_SUCCESS; } + +void context__add_to_by_id(struct mosquitto *context) +{ + if(context->in_by_id == false){ + context->in_by_id = true; + HASH_ADD_KEYPTR(hh_id, db.contexts_by_id, context->id, strlen(context->id), context); + } +}