Fix release tests.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3876 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2022-05-21 01:38:13 +00:00
parent 787e929747
commit 939e13c3c8
5 changed files with 29 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
{

View File

@ -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);