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:
parent
787e929747
commit
939e13c3c8
2
Makefile
2
Makefile
@ -16,7 +16,7 @@ CFLAGS += \
|
|||||||
LDFLAGS += -Wl,-gc-sections
|
LDFLAGS += -Wl,-gc-sections
|
||||||
|
|
||||||
debug: CFLAGS += -Og -g
|
debug: CFLAGS += -Og -g
|
||||||
release: CFLAGS += -DNDEBUG -O3
|
release: CFLAGS += -DNDEBUG -O3 -g
|
||||||
win: CC = i686-w64-mingw32-gcc-win32
|
win: CC = i686-w64-mingw32-gcc-win32
|
||||||
win: AS = $(CC)
|
win: AS = $(CC)
|
||||||
win: CFLAGS += -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNTDDI_VERSION=NTDDI_WIN10
|
win: CFLAGS += -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNTDDI_VERSION=NTDDI_WIN10
|
||||||
|
@ -2063,6 +2063,7 @@ tf_ssb_connection_t* tf_ssb_connection_create(tf_ssb_t* ssb, const char* host, c
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
printf("uv_tcp_connect(%s): %s\n", host, uv_strerror(result));
|
printf("uv_tcp_connect(%s): %s\n", host, uv_strerror(result));
|
||||||
|
connection->connect.data = NULL;
|
||||||
_tf_ssb_connection_destroy(connection, "connect failed");
|
_tf_ssb_connection_destroy(connection, "connect failed");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -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);
|
last_row_id = sqlite3_last_insert_rowid(db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("bind failed\n");
|
||||||
|
}
|
||||||
sqlite3_finalize(statement);
|
sqlite3_finalize(statement);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -233,6 +233,10 @@ static JSValue _tf_ssb_storeMessage(JSContext* context, JSValueConst this_val, i
|
|||||||
{
|
{
|
||||||
tf_ssb_notify_message_added(ssb, id);
|
tf_ssb_notify_message_added(ssb, id);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("Failed to store message.\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -22,9 +22,13 @@ void tf_ssb_test_id_conversion(const tf_test_options_t* options)
|
|||||||
(void)bin;
|
(void)bin;
|
||||||
(void)str;
|
(void)str;
|
||||||
(void)k_id;
|
(void)k_id;
|
||||||
assert(tf_ssb_id_str_to_bin(bin, k_id));
|
bool b = tf_ssb_id_str_to_bin(bin, k_id);
|
||||||
assert(tf_ssb_id_bin_to_str(str, sizeof(str), bin));
|
(void)b;
|
||||||
assert(strcmp(str, k_id) == 0);
|
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 {
|
typedef struct _test_t {
|
||||||
@ -107,8 +111,11 @@ void tf_ssb_test_ssb(const tf_test_options_t* options)
|
|||||||
sqlite3* db0 = NULL;
|
sqlite3* db0 = NULL;
|
||||||
sqlite3* db1 = NULL;
|
sqlite3* db1 = NULL;
|
||||||
|
|
||||||
assert(sqlite3_open(":memory:", &db0) == SQLITE_OK);
|
int r = sqlite3_open(":memory:", &db0);
|
||||||
assert(sqlite3_open(":memory:", &db1) == SQLITE_OK);
|
(void)r;
|
||||||
|
assert(r == SQLITE_OK);
|
||||||
|
r = sqlite3_open(":memory:", &db1);
|
||||||
|
assert(r == SQLITE_OK);
|
||||||
|
|
||||||
uv_loop_t loop = { 0 };
|
uv_loop_t loop = { 0 };
|
||||||
uv_loop_init(&loop);
|
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);
|
tf_ssb_append_message(ssb0, message);
|
||||||
JS_FreeValue(context, message);
|
JS_FreeValue(context, message);
|
||||||
|
|
||||||
assert(tf_ssb_db_blob_get(ssb0, blob_id, NULL, NULL));
|
b = tf_ssb_db_blob_get(ssb0, blob_id, NULL, NULL);
|
||||||
assert(!tf_ssb_db_blob_get(ssb1, 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);
|
tf_ssb_server_open(ssb0, 12347);
|
||||||
|
|
||||||
uint8_t id0bin[k_id_bin_len];
|
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");
|
printf("Testing following.\n");
|
||||||
sqlite3* db0 = NULL;
|
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_t loop = { 0 };
|
||||||
uv_loop_init(&loop);
|
uv_loop_init(&loop);
|
||||||
|
Loading…
Reference in New Issue
Block a user