From c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 5 Oct 2019 15:09:28 +0200 Subject: global reindent, now with uncrustify hook enabled --- src/fs/test_fs_file_information.c | 120 +++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 60 deletions(-) (limited to 'src/fs/test_fs_file_information.c') diff --git a/src/fs/test_fs_file_information.c b/src/fs/test_fs_file_information.c index 1f008997f..3f6f2d5a8 100644 --- a/src/fs/test_fs_file_information.c +++ b/src/fs/test_fs_file_information.c @@ -44,21 +44,21 @@ /** * How long should our test-content live? */ -#define LIFETIME GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 15) +#define LIFETIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15) static int -mycleaner(void *cls, struct GNUNET_FS_FileInformation *fi, uint64_t length, - struct GNUNET_CONTAINER_MetaData *meta, struct GNUNET_FS_Uri **uri, - struct GNUNET_FS_BlockOptions *bo, int *do_index, void **client_info) +mycleaner (void *cls, struct GNUNET_FS_FileInformation *fi, uint64_t length, + struct GNUNET_CONTAINER_MetaData *meta, struct GNUNET_FS_Uri **uri, + struct GNUNET_FS_BlockOptions *bo, int *do_index, void **client_info) { return GNUNET_OK; } static void -run(void *cls, char *const *args, const char *cfgfile, - const struct GNUNET_CONFIGURATION_Handle *cfg) +run (void *cls, char *const *args, const char *cfgfile, + const struct GNUNET_CONFIGURATION_Handle *cfg) { const char *keywords[] = { "down_foo", @@ -76,67 +76,67 @@ run(void *cls, char *const *args, const char *cfgfile, size_t i; struct GNUNET_FS_BlockOptions bo; - fs = GNUNET_FS_start(cfg, "test-fs-file-information", NULL, NULL, - GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END); - fn1 = GNUNET_DISK_mktemp("gnunet-file_information-test-dst"); - buf = GNUNET_malloc(FILESIZE); + fs = GNUNET_FS_start (cfg, "test-fs-file-information", NULL, NULL, + GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END); + fn1 = GNUNET_DISK_mktemp ("gnunet-file_information-test-dst"); + buf = GNUNET_malloc (FILESIZE); for (i = 0; i < FILESIZE; i++) - buf[i] = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, 256); - GNUNET_assert(FILESIZE == - GNUNET_DISK_fn_write(fn1, buf, FILESIZE, - GNUNET_DISK_PERM_USER_READ | - GNUNET_DISK_PERM_USER_WRITE)); - GNUNET_free(buf); - - fn2 = GNUNET_DISK_mktemp("gnunet-file_information-test-dst"); - buf = GNUNET_malloc(FILESIZE); + buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); + GNUNET_assert (FILESIZE == + GNUNET_DISK_fn_write (fn1, buf, FILESIZE, + GNUNET_DISK_PERM_USER_READ + | GNUNET_DISK_PERM_USER_WRITE)); + GNUNET_free (buf); + + fn2 = GNUNET_DISK_mktemp ("gnunet-file_information-test-dst"); + buf = GNUNET_malloc (FILESIZE); for (i = 0; i < FILESIZE; i++) - buf[i] = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, 256); - GNUNET_assert(FILESIZE == - GNUNET_DISK_fn_write(fn2, buf, FILESIZE, - GNUNET_DISK_PERM_USER_READ | - GNUNET_DISK_PERM_USER_WRITE)); - GNUNET_free(buf); - - meta = GNUNET_CONTAINER_meta_data_create(); - kuri = GNUNET_FS_uri_ksk_create_from_args(2, keywords); + buf[i] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 256); + GNUNET_assert (FILESIZE == + GNUNET_DISK_fn_write (fn2, buf, FILESIZE, + GNUNET_DISK_PERM_USER_READ + | GNUNET_DISK_PERM_USER_WRITE)); + GNUNET_free (buf); + + meta = GNUNET_CONTAINER_meta_data_create (); + kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); bo.content_priority = 42; bo.anonymity_level = 1; bo.replication_level = 0; - bo.expiration_time = GNUNET_TIME_relative_to_absolute(LIFETIME); + bo.expiration_time = GNUNET_TIME_relative_to_absolute (LIFETIME); fi1 = - GNUNET_FS_file_information_create_from_file(fs, - "file_information-context1", - fn1, kuri, meta, GNUNET_YES, - &bo); - GNUNET_assert(fi1 != NULL); + GNUNET_FS_file_information_create_from_file (fs, + "file_information-context1", + fn1, kuri, meta, GNUNET_YES, + &bo); + GNUNET_assert (fi1 != NULL); fi2 = - GNUNET_FS_file_information_create_from_file(fs, - "file_information-context2", - fn2, kuri, meta, GNUNET_YES, - &bo); - GNUNET_assert(fi2 != NULL); + GNUNET_FS_file_information_create_from_file (fs, + "file_information-context2", + fn2, kuri, meta, GNUNET_YES, + &bo); + GNUNET_assert (fi2 != NULL); fidir = - GNUNET_FS_file_information_create_empty_directory(fs, - "file_information-context-dir", - kuri, meta, &bo, NULL); - GNUNET_assert(GNUNET_OK == GNUNET_FS_file_information_add(fidir, fi1)); - GNUNET_assert(GNUNET_OK == GNUNET_FS_file_information_add(fidir, fi2)); - GNUNET_FS_uri_destroy(kuri); - GNUNET_CONTAINER_meta_data_destroy(meta); - GNUNET_assert(NULL != fidir); + GNUNET_FS_file_information_create_empty_directory (fs, + "file_information-context-dir", + kuri, meta, &bo, NULL); + GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1)); + GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2)); + GNUNET_FS_uri_destroy (kuri); + GNUNET_CONTAINER_meta_data_destroy (meta); + GNUNET_assert (NULL != fidir); /* FIXME: test more of API! */ - GNUNET_FS_file_information_destroy(fidir, &mycleaner, NULL); - GNUNET_DISK_directory_remove(fn1); - GNUNET_DISK_directory_remove(fn2); - GNUNET_free_non_null(fn1); - GNUNET_free_non_null(fn2); - GNUNET_FS_stop(fs); + GNUNET_FS_file_information_destroy (fidir, &mycleaner, NULL); + GNUNET_DISK_directory_remove (fn1); + GNUNET_DISK_directory_remove (fn2); + GNUNET_free_non_null (fn1); + GNUNET_free_non_null (fn2); + GNUNET_FS_stop (fs); } int -main(int argc, char *argv[]) +main (int argc, char *argv[]) { char *const argvx[] = { "test-fs-file_information", @@ -148,12 +148,12 @@ main(int argc, char *argv[]) GNUNET_GETOPT_OPTION_END }; - GNUNET_log_setup("test_fs_file_information", - "WARNING", - NULL); - GNUNET_PROGRAM_run((sizeof(argvx) / sizeof(char *)) - 1, argvx, - "test-fs-file_information", "nohelp", options, &run, - NULL); + GNUNET_log_setup ("test_fs_file_information", + "WARNING", + NULL); + GNUNET_PROGRAM_run ((sizeof(argvx) / sizeof(char *)) - 1, argvx, + "test-fs-file_information", "nohelp", options, &run, + NULL); return 0; } -- cgit v1.2.3