ssb: sequence: Sequential 32-bit integer starting at 1.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 32m2s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 32m2s
This commit is contained in:
@@ -114,7 +114,7 @@ static int _ssb_test_count_messages(tf_ssb_t* ssb)
|
||||
return count.count;
|
||||
}
|
||||
|
||||
static void _message_added(tf_ssb_t* ssb, const char* author, int64_t sequence, const char* id, void* user_data)
|
||||
static void _message_added(tf_ssb_t* ssb, const char* author, int32_t sequence, const char* id, void* user_data)
|
||||
{
|
||||
++*(int*)user_data;
|
||||
}
|
||||
@@ -1046,11 +1046,11 @@ void tf_ssb_test_publish(const tf_test_options_t* options)
|
||||
static void _test_print_identity(const char* identity, void* user_data)
|
||||
{
|
||||
tf_ssb_t* ssb = user_data;
|
||||
int64_t sequence = -1;
|
||||
int32_t sequence = -1;
|
||||
char id[k_id_base64_len] = { 0 };
|
||||
snprintf(id, sizeof(id), "@%s", identity);
|
||||
tf_ssb_db_get_latest_message_by_author(ssb, id, &sequence, NULL, 0);
|
||||
tf_printf("IDENTITY %s: %d\n", id, (int)sequence);
|
||||
tf_printf("IDENTITY %s: %d\n", id, sequence);
|
||||
}
|
||||
|
||||
void tf_ssb_test_replicate(const tf_test_options_t* options)
|
||||
@@ -1436,9 +1436,9 @@ void tf_ssb_test_triggers(const tf_test_options_t* options)
|
||||
clock_gettime(CLOCK_REALTIME, &end_time);
|
||||
tf_printf("insert = %f seconds\n", (end_time.tv_sec - start_time.tv_sec) + (end_time.tv_nsec - start_time.tv_nsec) / 1e9);
|
||||
|
||||
int64_t max_sequence = 0;
|
||||
int32_t max_sequence = 0;
|
||||
tf_ssb_db_get_latest_message_by_author(ssb0, id0, &max_sequence, NULL, 0);
|
||||
tf_printf("max_sequence=%" PRId64 "\n", max_sequence);
|
||||
tf_printf("max_sequence=%d\n", max_sequence);
|
||||
assert(max_sequence == 5);
|
||||
|
||||
sqlite3* db = tf_ssb_acquire_db_writer(ssb0);
|
||||
@@ -1447,7 +1447,7 @@ void tf_ssb_test_triggers(const tf_test_options_t* options)
|
||||
|
||||
max_sequence = 0;
|
||||
tf_ssb_db_get_latest_message_by_author(ssb0, id0, &max_sequence, NULL, 0);
|
||||
tf_printf("max_sequence=%" PRId64 "\n", max_sequence);
|
||||
tf_printf("max_sequence=%d\n", max_sequence);
|
||||
assert(max_sequence == 4);
|
||||
|
||||
tf_ssb_acquire_db_writer(ssb0);
|
||||
@@ -1456,7 +1456,7 @@ void tf_ssb_test_triggers(const tf_test_options_t* options)
|
||||
|
||||
max_sequence = 0;
|
||||
tf_ssb_db_get_latest_message_by_author(ssb0, id0, &max_sequence, NULL, 0);
|
||||
tf_printf("max_sequence=%" PRId64 "\n", max_sequence);
|
||||
tf_printf("max_sequence=%d\n", max_sequence);
|
||||
assert(max_sequence == 0);
|
||||
|
||||
uv_run(&loop, UV_RUN_DEFAULT);
|
||||
|
Reference in New Issue
Block a user