diff --git a/Makefile b/Makefile index 7d84546d..abcff705 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ CFLAGS += \ LDFLAGS += -Wl,-gc-sections debug: CFLAGS += -Og -g -release: CFLAGS += -DNDEBUG -O3 +release: CFLAGS += -DNDEBUG -O3 -g win: CC = i686-w64-mingw32-gcc-win32 win: AS = $(CC) win: CFLAGS += -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNTDDI_VERSION=NTDDI_WIN10 diff --git a/src/ssb.c b/src/ssb.c index 85656958..df11afcf 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -2063,6 +2063,7 @@ tf_ssb_connection_t* tf_ssb_connection_create(tf_ssb_t* ssb, const char* host, c if (result) { printf("uv_tcp_connect(%s): %s\n", host, uv_strerror(result)); + connection->connect.data = NULL; _tf_ssb_connection_destroy(connection, "connect failed"); } else diff --git a/src/ssb.db.c b/src/ssb.db.c index 4e854826..b053ffd4 100644 --- a/src/ssb.db.c +++ b/src/ssb.db.c @@ -183,6 +183,10 @@ bool tf_ssb_db_store_message(tf_ssb_t* ssb, JSContext* context, const char* id, last_row_id = sqlite3_last_insert_rowid(db); } } + else + { + printf("bind failed\n"); + } sqlite3_finalize(statement); } else diff --git a/src/ssb.js.c b/src/ssb.js.c index 0241ea3e..cf411b1b 100644 --- a/src/ssb.js.c +++ b/src/ssb.js.c @@ -233,6 +233,10 @@ static JSValue _tf_ssb_storeMessage(JSContext* context, JSValueConst this_val, i { tf_ssb_notify_message_added(ssb, id); } + else + { + printf("Failed to store message.\n"); + } } else { diff --git a/src/ssb.tests.c b/src/ssb.tests.c index e5f60676..98e945eb 100644 --- a/src/ssb.tests.c +++ b/src/ssb.tests.c @@ -22,9 +22,13 @@ void tf_ssb_test_id_conversion(const tf_test_options_t* options) (void)bin; (void)str; (void)k_id; - assert(tf_ssb_id_str_to_bin(bin, k_id)); - assert(tf_ssb_id_bin_to_str(str, sizeof(str), bin)); - assert(strcmp(str, k_id) == 0); + bool b = tf_ssb_id_str_to_bin(bin, k_id); + (void)b; + assert(b); + b = tf_ssb_id_bin_to_str(str, sizeof(str), bin); + assert(b); + b = strcmp(str, k_id) == 0; + assert(b); } typedef struct _test_t { @@ -107,8 +111,11 @@ void tf_ssb_test_ssb(const tf_test_options_t* options) sqlite3* db0 = NULL; sqlite3* db1 = NULL; - assert(sqlite3_open(":memory:", &db0) == SQLITE_OK); - assert(sqlite3_open(":memory:", &db1) == SQLITE_OK); + int r = sqlite3_open(":memory:", &db0); + (void)r; + assert(r == SQLITE_OK); + r = sqlite3_open(":memory:", &db1); + assert(r == SQLITE_OK); uv_loop_t loop = { 0 }; uv_loop_init(&loop); @@ -166,8 +173,10 @@ void tf_ssb_test_ssb(const tf_test_options_t* options) tf_ssb_append_message(ssb0, message); JS_FreeValue(context, message); - assert(tf_ssb_db_blob_get(ssb0, blob_id, NULL, NULL)); - assert(!tf_ssb_db_blob_get(ssb1, blob_id, NULL, NULL)); + b = tf_ssb_db_blob_get(ssb0, blob_id, NULL, NULL); + assert(b); + b = !tf_ssb_db_blob_get(ssb1, blob_id, NULL, NULL); + assert(b); tf_ssb_server_open(ssb0, 12347); uint8_t id0bin[k_id_bin_len]; @@ -234,7 +243,9 @@ void tf_ssb_test_following(const tf_test_options_t* options) { printf("Testing following.\n"); sqlite3* db0 = NULL; - assert(sqlite3_open(":memory:", &db0) == SQLITE_OK); + int r = sqlite3_open(":memory:", &db0); + (void)r; + assert(r == SQLITE_OK); uv_loop_t loop = { 0 }; uv_loop_init(&loop);