From: Ji Lu Date: Sun, 8 Nov 2009 22:15:45 +0000 (+0000) Subject: 98% test_bio.c X-Git-Tag: initial-import-from-subversion-38251~23139 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=608fd870746a39a82c06fe9904d050af778c57d8;p=oweals%2Fgnunet.git 98% test_bio.c --- 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 @@ -185,6 +185,19 @@ test_bigmeta_rw () return 0; } +static int +test_directory_r(void){ + char *msg; + char readResult[200]; + const char *fileName = "/dev"; + struct GNUNET_BIO_ReadHandle *fileR; + fileR = GNUNET_BIO_read_open (fileName); + GNUNET_assert (NULL != fileR); + GNUNET_assert (GNUNET_SYSERR == GNUNET_BIO_read (fileR, "Read error", readResult, 65537)); + GNUNET_BIO_read_close (fileR, &msg); + return 0; +} + static int test_nullfile_rw (void) { @@ -343,14 +356,14 @@ check_file_rw (void) { GNUNET_assert (0 == test_normal_rw ()); GNUNET_assert (0 == test_nullfile_rw ()); + GNUNET_assert (0 == test_directory_r()); return 0; } int -main (int argc, char *argv[]) -{ - GNUNET_assert (0 == check_file_rw ()); - GNUNET_assert (0 == check_metadata_rw ()); - GNUNET_assert (0 == check_string_rw ()); - return 0; +main (int argc, char *argv[]){ + GNUNET_assert (0 == check_file_rw()); + GNUNET_assert (0 == check_metadata_rw()); + GNUNET_assert (0 == check_string_rw()); + return 0; } /* end of main */