diff options
author | Ji Lu <jilu@140774ce-b5e7-0310-ab8b-a85725594a96> | 2009-11-08 22:15:45 +0000 |
---|---|---|
committer | Ji Lu <jilu@140774ce-b5e7-0310-ab8b-a85725594a96> | 2009-11-08 22:15:45 +0000 |
commit | 608fd870746a39a82c06fe9904d050af778c57d8 (patch) | |
tree | 1b9f9c9366d1e6955e8c5abdf0e5bcf91ce5cb2f /src/util/test_bio.c | |
parent | 65b0ebc8c31d7069df93a5e63a57007f372d035a (diff) | |
download | gnunet-608fd870746a39a82c06fe9904d050af778c57d8.tar.gz gnunet-608fd870746a39a82c06fe9904d050af778c57d8.zip |
98% test_bio.c
Diffstat (limited to 'src/util/test_bio.c')
-rw-r--r-- | src/util/test_bio.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/util/test_bio.c b/src/util/test_bio.c index 06dcfacc8..6fb132325 100644 --- a/src/util/test_bio.c +++ b/src/util/test_bio.c | |||
@@ -186,6 +186,19 @@ test_bigmeta_rw () | |||
186 | } | 186 | } |
187 | 187 | ||
188 | static int | 188 | static int |
189 | test_directory_r(void){ | ||
190 | char *msg; | ||
191 | char readResult[200]; | ||
192 | const char *fileName = "/dev"; | ||
193 | struct GNUNET_BIO_ReadHandle *fileR; | ||
194 | fileR = GNUNET_BIO_read_open (fileName); | ||
195 | GNUNET_assert (NULL != fileR); | ||
196 | GNUNET_assert (GNUNET_SYSERR == GNUNET_BIO_read (fileR, "Read error", readResult, 65537)); | ||
197 | GNUNET_BIO_read_close (fileR, &msg); | ||
198 | return 0; | ||
199 | } | ||
200 | |||
201 | static int | ||
189 | test_nullfile_rw (void) | 202 | test_nullfile_rw (void) |
190 | { | 203 | { |
191 | char *msg; | 204 | char *msg; |
@@ -343,14 +356,14 @@ check_file_rw (void) | |||
343 | { | 356 | { |
344 | GNUNET_assert (0 == test_normal_rw ()); | 357 | GNUNET_assert (0 == test_normal_rw ()); |
345 | GNUNET_assert (0 == test_nullfile_rw ()); | 358 | GNUNET_assert (0 == test_nullfile_rw ()); |
359 | GNUNET_assert (0 == test_directory_r()); | ||
346 | return 0; | 360 | return 0; |
347 | } | 361 | } |
348 | 362 | ||
349 | int | 363 | int |
350 | main (int argc, char *argv[]) | 364 | main (int argc, char *argv[]){ |
351 | { | 365 | GNUNET_assert (0 == check_file_rw()); |
352 | GNUNET_assert (0 == check_file_rw ()); | 366 | GNUNET_assert (0 == check_metadata_rw()); |
353 | GNUNET_assert (0 == check_metadata_rw ()); | 367 | GNUNET_assert (0 == check_string_rw()); |
354 | GNUNET_assert (0 == check_string_rw ()); | 368 | return 0; |
355 | return 0; | ||
356 | } /* end of main */ | 369 | } /* end of main */ |