I just decided. Braces on their own lines.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3668 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -37,15 +37,19 @@ static void _ssb_test_connections_changed(tf_ssb_t* ssb, tf_ssb_change_t change,
|
||||
|
||||
int count = 0;
|
||||
const char** c = tf_ssb_get_connection_ids(ssb);
|
||||
for (const char** p = c; *p; p++) {
|
||||
for (const char** p = c; *p; p++)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
free(c);
|
||||
|
||||
if (ssb == test->ssb0) {
|
||||
if (ssb == test->ssb0)
|
||||
{
|
||||
printf("callback0 change=%d connection=%p\n", change, connection);
|
||||
test->connection_count0 = count;
|
||||
} else if (ssb == test->ssb1) {
|
||||
}
|
||||
else if (ssb == test->ssb1)
|
||||
{
|
||||
printf("callback1 change=%d connection=%p\n", change, connection);
|
||||
test->connection_count1 = count;
|
||||
}
|
||||
@ -131,17 +135,20 @@ void tf_ssb_test_ssb(const tf_test_options_t* options)
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin);
|
||||
|
||||
while (test.connection_count0 != 1 ||
|
||||
test.connection_count1 != 1) {
|
||||
test.connection_count1 != 1)
|
||||
{
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
}
|
||||
tf_ssb_server_close(ssb0);
|
||||
|
||||
while (_ssb_test_count_messages(ssb1) < 3) {
|
||||
while (_ssb_test_count_messages(ssb1) < 3)
|
||||
{
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
}
|
||||
|
||||
printf("waiting for blob\n");
|
||||
while (!tf_ssb_db_blob_get(ssb1, blob_id, NULL, NULL)) {
|
||||
while (!tf_ssb_db_blob_get(ssb1, blob_id, NULL, NULL))
|
||||
{
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
}
|
||||
printf("done\n");
|
||||
@ -202,16 +209,19 @@ void tf_ssb_test_following(const tf_test_options_t* options)
|
||||
#define DUMP(id, depth)
|
||||
#else
|
||||
#define DUMP(id, depth) \
|
||||
do { \
|
||||
do \
|
||||
{ \
|
||||
printf("following %d:\n", depth); \
|
||||
const char** tf_ssb_get_following_deep(tf_ssb_t* ssb_param, const char** ids, int depth_param); \
|
||||
const char** f = tf_ssb_get_following_deep(ssb0, (const char*[]) { id, NULL }, depth); \
|
||||
for (const char** p = f; p && *p; p++) { \
|
||||
for (const char** p = f; p && *p; p++) \
|
||||
{ \
|
||||
printf("* %s\n", *p); \
|
||||
} \
|
||||
printf("\n"); \
|
||||
free(f); \
|
||||
} while (0)
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
FOLLOW(ssb0, id1, true);
|
||||
|
Reference in New Issue
Block a user