diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-04-30 08:57:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-04-30 08:57:16 +0000 |
commit | 8080b1223983045fc3374e67fc01be643a84a09f (patch) | |
tree | 0b1f889880863766c5cbcd9db6646cdfd01a728d /src/fs/test_fs_file_information.c | |
parent | 377c3e56c2b903b6cf57b687f20b2379299c5c89 (diff) | |
download | gnunet-8080b1223983045fc3374e67fc01be643a84a09f.tar.gz gnunet-8080b1223983045fc3374e67fc01be643a84a09f.zip |
towards fi synchronization
Diffstat (limited to 'src/fs/test_fs_file_information.c')
-rw-r--r-- | src/fs/test_fs_file_information.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/fs/test_fs_file_information.c b/src/fs/test_fs_file_information.c index 36a0771a3..c5b4ec997 100644 --- a/src/fs/test_fs_file_information.c +++ b/src/fs/test_fs_file_information.c | |||
@@ -83,8 +83,12 @@ run (void *cls, | |||
83 | struct GNUNET_FS_FileInformation *fi1; | 83 | struct GNUNET_FS_FileInformation *fi1; |
84 | struct GNUNET_FS_FileInformation *fi2; | 84 | struct GNUNET_FS_FileInformation *fi2; |
85 | struct GNUNET_FS_FileInformation *fidir; | 85 | struct GNUNET_FS_FileInformation *fidir; |
86 | struct GNUNET_FS_Handle *fs; | ||
86 | size_t i; | 87 | size_t i; |
87 | 88 | ||
89 | fs = GNUNET_FS_start (s, cfg, "test-fs-file-information", NULL, NULL, | ||
90 | GNUNET_FS_FLAGS_NONE, | ||
91 | GNUNET_FS_OPTIONS_END); | ||
88 | fn1 = GNUNET_DISK_mktemp ("gnunet-file_information-test-dst"); | 92 | fn1 = GNUNET_DISK_mktemp ("gnunet-file_information-test-dst"); |
89 | buf = GNUNET_malloc (FILESIZE); | 93 | buf = GNUNET_malloc (FILESIZE); |
90 | for (i = 0; i < FILESIZE; i++) | 94 | for (i = 0; i < FILESIZE; i++) |
@@ -109,7 +113,8 @@ run (void *cls, | |||
109 | 113 | ||
110 | meta = GNUNET_CONTAINER_meta_data_create (); | 114 | meta = GNUNET_CONTAINER_meta_data_create (); |
111 | kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); | 115 | kuri = GNUNET_FS_uri_ksk_create_from_args (2, keywords); |
112 | fi1 = GNUNET_FS_file_information_create_from_file ("file_information-context1", | 116 | fi1 = GNUNET_FS_file_information_create_from_file (fs, |
117 | "file_information-context1", | ||
113 | fn1, | 118 | fn1, |
114 | kuri, | 119 | kuri, |
115 | meta, | 120 | meta, |
@@ -117,7 +122,8 @@ run (void *cls, | |||
117 | 1, | 122 | 1, |
118 | 42, | 123 | 42, |
119 | GNUNET_TIME_relative_to_absolute (LIFETIME)); | 124 | GNUNET_TIME_relative_to_absolute (LIFETIME)); |
120 | fi2 = GNUNET_FS_file_information_create_from_file ("file_information-context2", | 125 | fi2 = GNUNET_FS_file_information_create_from_file (fs, |
126 | "file_information-context2", | ||
121 | fn2, | 127 | fn2, |
122 | kuri, | 128 | kuri, |
123 | meta, | 129 | meta, |
@@ -125,7 +131,8 @@ run (void *cls, | |||
125 | 1, | 131 | 1, |
126 | 42, | 132 | 42, |
127 | GNUNET_TIME_relative_to_absolute (LIFETIME)); | 133 | GNUNET_TIME_relative_to_absolute (LIFETIME)); |
128 | fidir = GNUNET_FS_file_information_create_empty_directory ("file_information-context-dir", | 134 | fidir = GNUNET_FS_file_information_create_empty_directory (fs, |
135 | "file_information-context-dir", | ||
129 | kuri, | 136 | kuri, |
130 | meta, | 137 | meta, |
131 | 1, | 138 | 1, |
@@ -144,6 +151,7 @@ run (void *cls, | |||
144 | GNUNET_DISK_directory_remove (fn2); | 151 | GNUNET_DISK_directory_remove (fn2); |
145 | GNUNET_free_non_null (fn1); | 152 | GNUNET_free_non_null (fn1); |
146 | GNUNET_free_non_null (fn2); | 153 | GNUNET_free_non_null (fn2); |
154 | GNUNET_FS_stop (fs); | ||
147 | } | 155 | } |
148 | 156 | ||
149 | 157 | ||